VS 2010 Make VB Read The File And Put The Information In The Right Variables?
Jun 22, 2011
Im creating a game like CityVille where you create a city and such. The game allows you to name your city and such and because I dont understand how to use the settings thing to save stuff I want to use a text file. I want the textfile to look like this:
city_name: namehere
money: moneyhere
plots: plotshere
population: pophere
smallhouseowned: numberhere
etcetc
How do I make VB read the file and put the information in the right variables?
View 11 Replies
ADVERTISEMENT
Oct 10, 2011
I am making trying to make a program that can read the file information directly from a specified file, but I am having a lot of difficulty reading things like file comments.An example of this can be found in windows XP when you alternate / right click on any file and click on properties. You'll get a lot of extra information.Now I have a few questions about this.
1.Can this information even be read in VB.NET
2.If so how
3.If not do I need to create some kind of data file to store the file information
Here is what I did so far
[Code]...
View 4 Replies
Jan 22, 2010
Im making a program that can make diffrent profiles. So it have to save: Username, Password, etc. then be able to read it.But I have no clue how to read diffrent lines, and stuff.I was thinking if ex. the pass was like this:<Pass>Pass here</Pass>I can read what was between those things, but I coulnt get it to work ...
View 14 Replies
Dec 24, 2010
My text file is a settings file and I know I will be adding more to it in the future, right now it reads "autoplay=false;mintray=false;"I am currently using probably the most inefficient way to check both of those settings:
if contents = "autoplay=false;mintray=false;" then
elseif contents = "autoplay=false;mintray=true;" then
elseif contents = "autoplay=true;mintray=false;" true
elseif contents = "autoplay=true;mintray=true;"
endif
How can I read the file, find each word from the equals sign to the semicolon, and store each of them in a variable identified by the text before the equals sign? Something like this:
contents = "autoplay=false;mintray=false;"
autoplay = "false"
mintray = "false"
Also, how can I edit the settings in the text file without having to overwrite everything every time I save to it? For instance; finding mintray in the text file, and changing mintray to true instead of overwriting the file with "autoplay=false;mintray=true;".
This is my current
Reading
Dim fs As New FileStream("C:myfile.txt", FileMode.Open, FileAccess.Read)
Dim d As New StreamReader(fs)
[code]....
View 3 Replies
Apr 2, 2011
I have declared a variable for all the controls of my form (Dim result As String) and when i close the form (me.close()) and open it again, the value of the result var don't go to nothing (""). Why is that happening? Close is actually the unload of the form. Shouldn't it delete all the information of the variables?
View 2 Replies
Mar 31, 2011
I am trying to make a program that is able to read out information about my iPod. Now I ran into this little snag, it says "The method or operation is not implemented"
This is my
Imports IpodServiceLib
Public Class Form1
[CODE]..........................
View 5 Replies
Sep 19, 2009
OK, I am trying to create a "payroll" program and I want to be able to have end users add information to a file and have the program read that file
View 3 Replies
Apr 27, 2012
I have a folder with .mp3's and I would like to be able to read
Artist
Title
Duration / Length
Year
Album
How can I get that information?
View 1 Replies
Dec 9, 2009
I'm using Visual Basic express 2008.The application I am working on is the first major project I have ever undertook with visual basics. The application is a launcher for a private server for world of warcraft.I have a menu bar that pulls the file path of the wow.exe and puts it in a hidden textbox, I then have another option that saves this text to c:wowexe.txt. All of this works GREAT!
How can I read the .txt file to end and return the information stored in the .txt file to this line of code.
Dim RetVal
RetVal = Shell("This is where I need the data from the .txt file to be seen", 1)
If your wondering why I don't just type in the path of the .exe, it's simple, not everyone installs World of Warcraft on the C drive.
View 5 Replies
Dec 15, 2008
I have a text file that has a list of certain values and I need to read each one back to the correct variable.
View 2 Replies
Nov 7, 2009
I've been scrambling my brain to figure out how to access my FTP server thing to get a list of text files in a folder and to edit the contents of those files online.
View 1 Replies
Oct 28, 2009
I am trying to read information from any TXT file in a folder. How can I use *.txt?
View 2 Replies
Mar 12, 2012
I want to read some information from a .Sims3Pack file. Here's a link to the file format information. I only want to read the XML section. What is the easiest way to do this?
View 4 Replies
Feb 19, 2011
I want to read a comma seperated file, there are 4 columns. I want to read each column into a different variable.
Here are the data
1.89,Dog,434,0.754
45.32,Cat,674,89.6
....
[Code]....
View 4 Replies
Apr 15, 2010
I need to read information from excel and them put them into a text file,I have the part for text file done and write to it but I dont know how to go and read from an excel file where every row is a diferent record, so I need to read the entire row and put every cell on variables so I can get my fixed text file done.
View 1 Replies
Sep 17, 2011
When I use to do some Delphi programming you were able to define variable as a target for a comma delimited file and then under that give variable names for each field to fall into. I forget the syntax now but it looked something like this...
Using Getline as Record:
RecordId = Integer
RecordName = String
RecordAddress = String;
[Code]....
View 15 Replies
Aug 5, 2010
How do i read information from a mysql server and write all info on table name links to a file?
View 3 Replies
Jul 5, 2011
make a application where I can store a lot of account information in a file on my computer. This is how it works so far.I have a class called "AccountInfo" with some properties such as Account Name, Password, etc... This is bound to a DataGridView via a Bindingsource. So basicaly what I'm asking, is how can I save/load all these accounts in my computer easily in a file or something?
View 2 Replies
Dec 25, 2010
-to know when the file was created (i remember that it is possible as i've done it before)-if there are any other copies of the same file in the entire pc
View 1 Replies
Oct 3, 2009
I'm trying to make a program that can read .mp3 data (Such as Artist, Album, Year, Track number, etc), but I need to be able to do two things that I have no clue how to do:
1. Read starting from a specified string (E.G, On one line it states: [code]
2. Read until a specified string (E.G, On the previously stated line,I need to read starting from what I said, up until.
View 8 Replies
Nov 17, 2011
Is their anyway of getting the meta information of a file?[code]I've been searching Google for over an hour and found very little help.
View 2 Replies
Aug 18, 2010
I'm making an picture manager for personal use, and was wondering if it's possible to list up more information of an image. For instance, In Windows 7 there is a feature when I left click one time at a picture I get a little thumbnail and some information about the picture, like: Dimensions, ISO-Speed, Camera producer, blitz mode etc.
So my question is; How can this be implemented to Visual Basic 2010?
View 5 Replies
Mar 5, 2012
i want make a program like a login tool game..in login tool program..i put a button and WebBrowser page..then i want make a my button and WebBrowser read link or target in ini file or inf file...how to make it?
View 2 Replies
Feb 22, 2011
Is there a way to read an image pixle by pixle and create a text file based in the information.Lets assume we are reading each pixle from left to right. Once you reach the last pixle of the line you move to the line below that one and continue reading.Here is a very simple "if" statement to help visualize the process:
[code]...
View 1 Replies
Jan 2, 2010
I have a text file containing 10 pieces of information. I want to read the information from the text file and put it in text boxes on a form, so that the user can view the information and edit if required. What is the best way of approaching this?
View 4 Replies
Apr 17, 2011
I am working with the formula for writing information to a text file. I have a program with 4 text box's and 5 radio buttons. I need to the program to write all of the info from the 4 text box's that the user has entered and the radio button that the user has selected.
View 5 Replies
Aug 27, 2009
I am using VB2005 and trying to put an application together.What it needs to do is retrieve information from a binary file, possibly alter that information, and put it back into a new file.The file is a .wav file with data appened to the end. There is an additional section at the end of the .wav file which stores xml data.I have found that if I open this in a hex editor and make a 1:1 swap on any of the bytes that the application that the file is for can still read the XML.If I tried to add or remove characters from the XML then it would not read. I located a header byte and incremented it to resolve this.
This worked as an excellent bandage to do conversions where the data always needed to be changed to the same thing.What I have been asked to do is build logic that allows for different things to happen depending upon what data is contained within the file.The method that I am currently trying to impliment is:
Read through the file with a system.io.binaryreader
Searche for a bytestream that will signal data is coming
For example:
If System.IO.File.Exists("C: est estread.wav") Then
Dim findit() As Integer = New Integer() {&H3C, &H55, &H73, &H72, &H44, &H65, &H66, &H30, &H31, &H30}
Dim i As Integer[code].....
And then extract all the data till the end of element marker "<" It seemed like there should be a better way and I was looking for some insight. If I proceed with this method, I will have to read the file one time to gather the information and then a second time to write it all out with the header modified for length.This is my first experiene with working with binary files in this way.Also,I've been experiementing with building a string and slapping it back in at the end using the binarywriter.write(string) method.I noticed that it was putting in header characters before the string.These seem to change if I change the length of the string.At one point it was d0 07. Later it became e7 07. Does anyone know of a way to prevent this header from being inserted?
I tried a for each loop to grab all of the characters from the string, convert them to a byte array and deposit the byte array into the file, but the header remained the same. When I write the byte array generated from a system.io.binaryreader I do not get this header.
View 1 Replies
Jun 11, 2011
I want to read a HTTP Post that comes from a server to a website. I am trying to write a script that basically parse the HTTP post that comes in as text format and read the variables in the text file then add them to a database.
I know how to do the second part but I am unsure about how to read the text file variables that comes from the HTTP Post
The HTTP post that get sent looks as below
CODE:
No Insurance
I am trying to write a code for this and have the code below
CODE:
How do I get the variables in this text file, mainly start after ":" and the last 3
View 2 Replies
Apr 27, 2012
I need to store specific information about a user in a file of some sort. Something like an old ini file?
I will need to save a file for each customer.
CustomerName
OrderDate
DeliveryDate
[Code]....
All things point to a database but for several reasons I can't use a database.
View 2 Replies
Jul 10, 2011
I need to read some information from a txt file and put all that info to a textbox (this is ready and done)but the textfile have some variables like %userName% that i need to replace programatically in vb.net?example of text file:hello %userName% , this is an automated report of the uses of your account. this is what the txt file have in it, when i read it to vb.net and put that info into a textbox is done right, but the question is how to replace the %userNams% for some text in another textbox and replaced when i press a button?
View 1 Replies