read from .txt menu

User Tag List

Results 1 to 9 of 9
  1. #1
    Spot_1337's Avatar Active Member
    Reputation
    16
    Join Date
    Feb 2007
    Posts
    90
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    read from .txt

    Hello,

    i'm trying to save checkbox.checkstate like in this code
    Code:
    Dim sound As New System.IO.StreamWriter("C:\Alarm\" + "Sound.txt")
                sound.WriteLine(CheckBox1.CheckState)
                sound.Close()
    
                Dim shutdown As New System.IO.StreamWriter("C:\Alarm\" + "Shutdown.txt")
                shutdown.WriteLine(CheckBox2.CheckState)
                shutdown.Close()
    and it works fine, just that when i read it it will just read checkbox1 not checkbox2.
    Read code
    Code:
    Dim soundread As New System.IO.StreamReader("C:\Alarm\" + "Sound.txt")
                Dim sr As String
                sr = soundread.ReadLine
                If sr = "1" Then
                    CheckBox1.CheckState = CheckState.Checked
                    If sr = "0" Then
                        CheckBox1.CheckState = CheckState.Unchecked
                        soundread.Close()
    
                        Dim shutdownread As New System.IO.StreamReader("C:\Alarm\" + "Shutdown.txt")
                        Dim sdr As String
                        sdr = soundread.ReadLine
                        If sdr = "1" Then
                            CheckBox2.CheckState = CheckState.Checked
                            If sdr = "0" Then
                                CheckBox2.CheckState = CheckState.Unchecked
                                shutdownread.Close()
    And btw, try to explain so noobs like me understand.
    +2 +Rep if u help me with this :wave:
    Last edited by Spot_1337; 01-14-2009 at 11:17 AM.

    read from .txt
  2. #2
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    writer.WriteLine(ColorDialog1.Color.ToARGB())

    colr = colorread.ReadLine
    colrArgb = Convert.ToInt32(colr)
    Form2.BackColor = Color.FromARGB(colrArgb)

  3. #3
    Spot_1337's Avatar Active Member
    Reputation
    16
    Join Date
    Feb 2007
    Posts
    90
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aww, it's working thank you soo much! +2 rep (still have the other problem, "read from .txt ")
    Last edited by Spot_1337; 01-14-2009 at 11:30 AM.

  4. #4
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    Dim soundread As New System.IO.StreamReader("C:\Alarm\Sound.txt")
                Dim sr As String
                sr = soundread.ReadLine
                If sr = "1" Then CheckBox1.CheckState = CheckState.Checked
                If sr = "0" Then CheckBox1.CheckState = CheckState.Unchecked
                soundread.Close()
                Dim shutdownread As New System.IO.StreamReader("C:\Alarm\Shutdown.txt")
                Dim sdr As String
                sdr = soundread.ReadLine
                If sdr = "1" Then CheckBox2.CheckState = CheckState.Checked
                If sdr = "0" Then CheckBox2.CheckState = CheckState.Unchecked
                shutdownread.Close()
    You needed to close the Ifs (Or what I did, which makes the entire If one line)

  5. #5
    Spot_1337's Avatar Active Member
    Reputation
    16
    Join Date
    Feb 2007
    Posts
    90
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nvm got it to work, just made private subs , thanks for helping me

  6. #6
    Spot_1337's Avatar Active Member
    Reputation
    16
    Join Date
    Feb 2007
    Posts
    90
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aww to late to see your post well worked with priv subs so thanks anyway

  7. #7
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    np, glad to help out

  8. #8
    JoeBiden's Avatar Contributor
    Reputation
    153
    Join Date
    Aug 2007
    Posts
    498
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is completely offtopic but i always use If Checkbox1.Checked = true

    just funny how you can do things in many diferent ways.

    Also, what kinda program you making?

  9. #9
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, since you're doing GUI settings saves, just use the built in Settings stuff.

    Click your control you want to have a setting saved for -> Properties -> ApplicationData -> Settings can be changed from here. (I.E: Checkboxes have a Checked setting you can save, etc.)

    I don't remember if you need to in VB, but for safety's sake, create a new event handler for Form_Closing(...) and add Properties.Settings.Default.Save() in there just to make sure your settings save before closing the app. (I know it's required in C#.)

    No need to do any extra work, etc.

Similar Threads

  1. Read from Pointer Windows 10 issue
    By doromoro in forum WoW Memory Editing
    Replies: 2
    Last Post: 07-28-2016, 01:06 PM
  2. Possible ways to read from D3 chat
    By Ynnej in forum Diablo 3 Bots Questions & Requests
    Replies: 0
    Last Post: 04-09-2013, 02:06 PM
  3. Spell info reading from DBC
    By guizmows in forum WoW Memory Editing
    Replies: 4
    Last Post: 06-01-2011, 04:17 PM
  4. LUA Help (reading from/writing to files)
    By tagala in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 10-05-2009, 06:48 PM
  5. [Help] vb6 Reading from a random file
    By Murdok in forum Programming
    Replies: 3
    Last Post: 10-20-2008, 12:39 PM
All times are GMT -5. The time now is 02:46 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