Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Physcadelic's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Australia <3
    Posts
    4,450
    Reputation
    323
    Thanks
    828
    My Mood
    Breezy

    [Help]Create program files folder when run[Solved]

    Well this is VERY nooby, but I just started VB.

    When the user runs the program I want a folder to be created in their program files, and a .txt inside that folder. I know how to do this, but how would I actually name the folder like "Test Program" and the .txt to actually contain text. How would I write text to the .txt when the programs runs?

    R.I.P a great GM




    Quote Originally Posted by Assalamu alaikum View Post
    what? maybe stop talk with riddles and with words i am not even know.

  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    [php]Io.Directory.CreateDirectory("Path")
    [/php]
    [php]
    Using sWrite as new io.streamwriter("Path", append as boolean)
    swrite.write(text)
    end using[/php]



  3. #3
    Physcadelic's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Australia <3
    Posts
    4,450
    Reputation
    323
    Thanks
    828
    My Mood
    Breezy
    Getting alot of errors doing that.

    R.I.P a great GM




    Quote Originally Posted by Assalamu alaikum View Post
    what? maybe stop talk with riddles and with words i am not even know.

  4. #4
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Quote Originally Posted by Physcadelic View Post
    Getting alot of errors doing that.
    Good, since ik your code + errors, I can sure help you.

    Oh wait...



  5. #5
    Physcadelic's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Australia <3
    Posts
    4,450
    Reputation
    323
    Thanks
    828
    My Mood
    Breezy
    Quote Originally Posted by Blubb1337 View Post
    Good, since ik your code + errors, I can sure help you.

    Oh wait...
    Sorry, just telling you
    Code:
    Public Class Form1
         
         Io.Directory.CreateDirectory("C:\Program Files\programname")
       Using sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
        swrite.write(Text in filename.txt)
        End Using
    Errors: End using must be preceeded by a matching using.
    Io.Directory.CreateDirectory("C:\Program Files\programname") - Declaration expected at IODirectory.CreateDirectory("C:\Program Files\programname") -
    Declaration Expected at sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
    Statement cannot appear out of method body: Using sWrite as new io.streamwriter("C:\Program

    R.I.P a great GM




    Quote Originally Posted by Assalamu alaikum View Post
    what? maybe stop talk with riddles and with words i am not even know.

  6. #6
    Iamazn1's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    407
    Reputation
    12
    Thanks
    50
    Instead of
    Code:
    Using sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
        swrite.write(Text in filename.txt)
        End Using
    use
    Code:
    IO.File.WriteAllText("C:\Program Files\programname\filename.txt", "Contents of filename.txt")

  7. #7
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Physcadelic View Post
    Sorry, just telling you
    Code:
    Public Class Form1
         
         Io.Directory.CreateDirectory("C:\Program Files\programname")
       Using sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
        swrite.write(Text in filename.txt)
        End Using
    Errors: End using must be preceeded by a matching using.
    Io.Directory.CreateDirectory("C:\Program Files\programname") - Declaration expected at IODirectory.CreateDirectory("C:\Program Files\programname") -
    Declaration Expected at sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
    Statement cannot appear out of method body: Using sWrite as new io.streamwriter("C:\Program
    Lolz I please you to actually look at code before C+Ping it.

    [php]
    IO.Directory.CreateDirectory("C:\Program Files\programname")
    Using sWriter As new IO.StreamWriter("C:\Program Files\programname\test.txt", False)
    sWriter.Write(String.Join(ControlChars.CrLf, New String() {"Please read", "The fucking code", "before you copy it"}))
    End Using
    [/php]

    And put the code in a method body for gawds sake.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  8. #8
    Physcadelic's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Australia <3
    Posts
    4,450
    Reputation
    323
    Thanks
    828
    My Mood
    Breezy
    Quote Originally Posted by Iamazn1 View Post
    Instead of
    Code:
    Using sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
        swrite.write(Text in filename.txt)
        End Using
    use
    Code:
    IO.File.WriteAllText("C:\Program Files\programname\filename.txt", "Contents of filename.txt")
    Thanks, that worked, and thankyou too Blubb, I guess I'm just too stupid to understand your code..

    R.I.P a great GM




    Quote Originally Posted by Assalamu alaikum View Post
    what? maybe stop talk with riddles and with words i am not even know.

  9. #9
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Physcadelic, don't get all mad at me for voting against copy and pasting, there's no need to throw around negative rep just because you can't handle criticism.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  10. #10
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Jason View Post
    Physcadelic, don't get all mad at me for voting against copy and pasting, there's no need to throw around negative rep just because you can't handle criticism.
    Lol, agree. Btw, what was the de-rep message ? :P

  11. #11
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Hassan View Post


    Lol, agree. Btw, what was the de-rep message ? :P
    Quote Originally Posted by Physcadelic
    Yeah I'm new, don't have to be a jerk..
    So yeah... Thanks for the rep though Hassan.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  12. #12
    Physcadelic's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Australia <3
    Posts
    4,450
    Reputation
    323
    Thanks
    828
    My Mood
    Breezy
    Quote Originally Posted by Jason View Post
    Physcadelic, don't get all mad at me for voting against copy and pasting, there's no need to throw around negative rep just because you can't handle criticism.
    ohshit sorry about this, was a total overreaction
    Anyone that reads this de-rep me

    R.I.P a great GM




    Quote Originally Posted by Assalamu alaikum View Post
    what? maybe stop talk with riddles and with words i am not even know.

  13. #13
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Physcadelic View Post
    ohshit sorry about this, was a total overreaction
    Anyone that reads this de-rep me
    There's no need to de-rep you as I repped him already, but be careful next time. If you won't face the criticism, you won't be able to learn new things.

  14. #14
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by Hassan View Post


    There's no need to de-rep you as I repped him already, but be careful next time. If you won't face the criticism, you won't be able to learn new things.
    are you on drugs son? I rage all over the place to anyone who says im wrong!!!
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  15. The Following User Says Thank You to 'Bruno For This Useful Post:

    Lolland (01-12-2011)

  16. #15
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Brinuz View Post
    are you on drugs son? I rage all over the place to anyone who says im wrong!!!
    Yeah but you're never wrong so you have a reason to be annoyed

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  17. The Following User Says Thank You to Jason For This Useful Post:

    'Bruno (01-12-2011)

Page 1 of 2 12 LastLast