Save info

how can i make a program ask a question, save the answer somewhere and never ask the question again but remembers the info even when it is resarted and can refer to it. so like if i said my name is ben the first time i ran it every time it started up it said "hello ben" or what ever i'd put.


Answer this question

Save info

  • Xinwei Hong - MSFT

    + can any one translate this for me it's probablly right but i can't understand it.

     

    __________________________________________________________________

    You can create a new setting using the application settings designer. Make sure that the type is String and the Scope is User and the value is an empty string (those are the default values)< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    When you start your application, you can check if your settings value is an empty string, and if so, prompt the user and store the reply in the setting and save it.

    Check out http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/vbmysettings.asp for more information on how to use My.Settings/the settings designer in Visual Basic/Visual Studio 2005

     



  • Ryno1234

    The qualities of answers, cannot exceed the clearity of questions asked.

    A program can't really ask a question. It can present a striing that a human will intrpret as a question.

    Save the answer Where The appropropriateness of the selection of "where" depends on know a know lot more about the kinds of questions and their range and you desired granuality on being able to retrieve it.

    Were I to ask a contractor... "Would you build a home for me " The first thing she'd ask for would be for blueprints. She'd want to know, "Is this house smaller than a bread box or larger than a sherman tank Then she'd say "Where do you want to build "

    If I said, "somewhere", we probably would not have a long talk.

    Does this make sense



  • azzurrapoint

    Thanks everybody thts solved my prob thnks!!!

  • Francois Tanguay

    ok we're nearly there.

    i tried the code ubove, but Vb doesn't recongnize it. I'm using Vb 6.0 does tht matter



  • Angela Bodnar

    Dim Instring as string

    Dim stream_reader As New IO.StreamReader("textfile.txt")
    instring = stream_reader.ReadToEnd()
    stream_reader.Close()

    Will read a file into instring....



  • Marius Bancila

    You can create a new setting using the application settings designer. Make sure that the type is String and the Scope is User and the value is an empty string (those are the default values)

    When you start your application, you can check if your settings value is an empty string, and if so, prompt the user and store the reply in the setting and save it.

    Check out http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/vbmysettings.asp for more information on how to use My.Settings/the settings designer in Visual Basic/Visual Studio 2005

    Best regards,
    Johan Stenberg



  • Brian MCSD

    yeah

     

     

    what i want is it to read data from a txt file idealy.

    so like i write down my name is ben in a text file and the program reads the txt file and says hello ben



  • Susan2

    uh-oh.

    Col you realize of course that my job is close VB6 threads. :

    I'm not going to do that instantly because I'm going to divert everybit of my energy into encoraging to to download your own FREE personal copy of VBExpress. It's so much more powerful than VB6 that it's inbelievable. Without pausing, without heistating, before you do anything else, right now.

    Please go download VB Express. Please. You'll find it on microsoft.com.

    I'll help you when you have it downloaded because right now we are speaking two different languages an my function is to insure that VB doesn't distract anyone here.

    Please let me know when you have it downloaed.



  • Save info