Results 1 to 4 of 4

Thread: [2005] Saving info ???

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    60

    [2005] Saving info ???

    I am currently making a very basic web browser and I have setup the "enter the URL of your homepage" part the way I want it, in the MenuBar... What I want to know is, What code makes the application save a textbox entry (without a submit/accept/change etc... button) for future reference, even if computer is shutdown or whatever?

  2. #2

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    60

    Re: [2005] Saving info ???

    Oh, and also, Can someone give me the code to have the webrowser focused in a loop like

    Do WebBrowser1.Focus
    Loop

    This is for games were you need to use arrows keys and letter keys and it focuses on the textbox insted...

  3. #3
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] Saving info ???

    Quote Originally Posted by Chael
    I am currently making a very basic web browser and I have setup the "enter the URL of your homepage" part the way I want it, in the MenuBar... What I want to know is, What code makes the application save a textbox entry (without a submit/accept/change etc... button) for future reference, even if computer is shutdown or whatever?
    There isn't a specific "code" to do this. Your application runs in volatile memory meaning once power is gone from the memory, the memory is cleared. To save your data, you'd want to put it some place else that's permenant like a hard drive.

    You have tons of ways to do this. you can save a text file with a StreamWriter and use a StreamReader to read it back in, you could use an XmlWriter to write it as Xml, you could serialize your data either through Xml or Binary Serialization, save into the registry, save in an ini file, etc... the list goes on and on.
    Quote Originally Posted by Chael
    Oh, and also, Can someone give me the code to have the webrowser focused in a loop like

    Do WebBrowser1.Focus
    Loop

    This is for games were you need to use arrows keys and letter keys and it focuses on the textbox insted...
    You could put a loop in the event that triggers when the web browser loses focus to bring it back, but a loop isn't the answer here as that'll slow down your app. I haven't used the Web Browser control yet so someone else would have more insight, though I'd image there would be some properties to change to fix this.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,460

    Re: [2005] Saving info ???

    You should create an application setting that corresponds to the user's home page. You would go to the Settings tab of the project properties and add a new setting of type String with User scope. If you were to name it "HomePage" you can then refer to it in code as My.Settings.HomePage. It will be automatically loaded at startup and by default it will be automatically saved at shutdown. A separate copy will be kept for each Windows user so they can each have their own home page. You can also bind control properties to settings if desired via the ApplicationSettings section in the Properties window.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width