[Help] saveing config menu

User Tag List

Results 1 to 11 of 11
  1. #1
    kazama's Avatar Member
    Reputation
    11
    Join Date
    Feb 2007
    Posts
    76
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] saveing config

    Hallo anyone (-:

    I need help with a code in visual basic 2005/2008

    I have make a tabbede program in one of the tab are a some textbox and a save button, i need a code that can get what i type in the textbox to be remembered when i close the program and start it agian it need to start with the text in the textbox as i type befor i shutdown the program...

    anyone know how? (-:

    i'll be realy happy if you can help me..

    [Help] saveing config
  2. #2
    Ryoushi.'s Avatar Member
    Reputation
    54
    Join Date
    Nov 2008
    Posts
    126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the code for the first button to save the text to your file. Make sure the textbox you want is Textbox1 as it specifies.

    Code:
     If System.IO.File.Exists(C:\FileOfChoice.txt) = True Then
                Dim wr As IO.TextWriter
                wr = IO.File.CreateText(C:\FileOfChoice.txt)
                wr.Write(TextBox1.Text)
                wr.WriteLine()
                wr.Flush()
                wr.Close()
    Now for a button to load the text try:
    Code:
    Dim FILENAME As String = "C:\FileOfChoice.txt"
    If System.IO.File.Exists(FILENAME) = True Then
    Dim objReader As New System.IO.StreamReader(FILENAME)
    TextBox1.Text = objReader.ReadToEnd
    objReader.Close()
    Else
    MsgBox("File cannot be found")
    End If

    So there should be two buttons and a textbox (Textbox1)
    The first button saves the text in the textbox to the file, and the second loads the text from the file into the textbox.


    Hope that helps. :-)

  3. #3
    kazama's Avatar Member
    Reputation
    11
    Join Date
    Feb 2007
    Posts
    76
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks you so much but it's given me 3 error:

    Error 1 ')' expected. C:\Users\Name\Documents\Visual Studio 2005\Projects\Program open\Program open\Form1.vb 30 34 Program open

    And

    Error 2 Name 'c' is not declared. C:\Users\Casper\Documents\Visual Studio 2005\Projects\Program open\Program open\Form1.vb 30 34 Program open

    and

    Error 3 Syntax error. C:\Users\Casper\Documents\Visual Studio 2005\Projects\Program open\Program open\Form1.vb 30 36 Program open

    Any idêe how to fixs it?

  4. #4
    Ryoushi.'s Avatar Member
    Reputation
    54
    Join Date
    Nov 2008
    Posts
    126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, the directories should be in quotes. I forgot to type them :3

    "C:\Users\Casper\Documents\Visual Studio 2005\Projects\Program open\Program open\Form1.vb"

    With quotes.

  5. #5
    kazama's Avatar Member
    Reputation
    11
    Join Date
    Feb 2007
    Posts
    76
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks you so much agian Ryoushi. it's work just like it need to.
    +Rep

    Edit: Can't rep you yet already did it once earlyer ^^
    Last edited by kazama; 11-20-2008 at 01:58 PM.

  6. #6
    Ryoushi.'s Avatar Member
    Reputation
    54
    Join Date
    Nov 2008
    Posts
    126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's alright. :-)
    Glad to help.

  7. #7
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the default Visual Studio MySettings setup.

    It's much easier.


  8. #8
    kazama's Avatar Member
    Reputation
    11
    Join Date
    Feb 2007
    Posts
    76
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ryoushi, you sems to know alot about Vb, do you know how to get my program to open ex. FireFox or Wow when i click in CheckBox1 then it open firefox and when i click on CheckBox2 then it open WoW but when i type in the part to where my Inter Explorer are in the textbox1 then when i CheckBox1 it well open IE and not firefox.
    I have try this
    Code:
    PrivateSub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If CheckBox12.Checked = TrueThen
    if textbox1.text = "" then
    Process.Start("C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
    else 
    Process.Start("textbox1.text")
    end sub
    end class
    and
    Code:
    navigate = TextBox1.Text
    but no of thors work : /

    Think you can help me with this to? :P

  9. #9
    Ryoushi.'s Avatar Member
    Reputation
    54
    Join Date
    Nov 2008
    Posts
    126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    If CheckBox12.Checked = TrueThen
    Is it supposed to be Checkbox12...?

    Also, your code says:
    Code:
    if textbox1.text = "" then
    Process.Start("C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
    else 
    Process.Start("textbox1.text")
    So the if textbox1.text = "" part is saying that if the textbox is empty, open firefox.
    But the textbox isn't empty, so it's starting whatever is in textbox1.text because of the 'else'.

  10. #10
    Murdok's Avatar Member
    Reputation
    34
    Join Date
    Oct 2007
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i believe it is

    checkbox1.value = "1"

    and the other code will open firefox if it is empty but it needs an end if

    There are 10 kinds of people in the world. Those who understand binary and those who don't.

  11. #11
    kazama's Avatar Member
    Reputation
    11
    Join Date
    Feb 2007
    Posts
    76
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well nvm, Ryoushi you just asw me in the other post about config button (:

    If CheckBox12.Checked = TrueThen
    System.Diagnostics.Process.Start(TextBox1.Text)
    EndIf

Similar Threads

  1. [Help] a config button for program opener
    By Weiii in forum Programming
    Replies: 13
    Last Post: 11-25-2008, 12:02 PM
  2. Really need help website configs
    By ignorant in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 10-16-2008, 11:23 PM
  3. [Help] Router Config ç_ç
    By marcicompita in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 07-21-2008, 10:07 PM
  4. [Help!] [Error] [Configs] An error in Logonserver and World.
    By faxmunky in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 05-31-2008, 01:06 AM
  5. need help with config files!
    By ridders in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-23-2007, 05:31 PM
All times are GMT -5. The time now is 02:53 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search