473,396 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to read a particular setting from a file


Hi,

I have a plain text file called myVersions.ver which will have something
like this:

AppVersion: 1.0
DBVersion: 1.0

I will use this file to keep my app version number and database version.
My problem is that after extensive research I cannot figure out how to
read this file. I mean not simple read in which everything in file is
read as a stream. I want to specify that I want the setting
'AppVersion' or 'DBVersion'.

Basically:

1> I want to open this file
2> Query to read 'Appversion'

How can I do this. It's like reading a key in xml file.

Please Please help.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
3 1062
Hi

Did you already look in the AssemblyInfo.vb class.

That is in my opinion the easiest way to get what you want to archieve,

I hope this helps?

Cor
I have a plain text file called myVersions.ver which will have something
like this:

AppVersion: 1.0
DBVersion: 1.0

I will use this file to keep my app version number and database version.
My problem is that after extensive research I cannot figure out how to
read this file. I mean not simple read in which everything in file is
read as a stream. I want to specify that I want the setting
'AppVersion' or 'DBVersion'.

Basically:

1> I want to open this file
2> Query to read 'Appversion'

How can I do this. It's like reading a key in xml file.

Please Please help.

Nov 20 '05 #2
* dotnet dev <de****@hotmail.com> scripsit:
I have a plain text file called myVersions.ver which will have something
like this:

AppVersion: 1.0
DBVersion: 1.0

I will use this file to keep my app version number and database version.
My problem is that after extensive research I cannot figure out how to
read this file. I mean not simple read in which everything in file is
read as a stream. I want to specify that I want the setting
'AppVersion' or 'DBVersion'.

Basically:

1> I want to open this file
2> Query to read 'Appversion'

How can I do this. It's like reading a key in xml file.


\\\
Imports System.IO
..
..
..
Dim sr As StreamReader = _
New StreamReader("C:\WINDOWS\WIN.INI")
Do While sr.Peek > -1
Dim strLine As String = sr.ReadLine()
Dim astrParts() As String = Strings.Split(strLine, ": ")
If astrParts.Length > 0 Then
If astrParts(0) = "AppVersion" Then
...
End If
End If
Loop
sr.Close()
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
Thanks all.

dev

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jim | last post by:
Hi, I am trying to figure out a way to implement a timeout along with a read() call on an open file. It only has to work on linux, for now I am trying: ret = select.select( ,,, timeout ) if...
4
by: Chuck Ritzke | last post by:
Hi, I've been using VS for a number of projects and the debugger has worked as advertised until now. I have a desktop solution with three projects, two of which are class modules. For some...
2
by: GB | last post by:
Hi Everybody! I have 2 different processes/application. One is writing to a file and another is reading from it. For some reason the code doesnt seems to work and gives mscorlib.dll IOException...
2
by: rrossney | last post by:
Please look at the "what I've already done" section of this message before responding to it: I believe that I've done everything that the people who experience this error are typically told to do....
0
by: tjonsek | last post by:
I am working with directories in PHP for the first time. I have code that I've changed multiple times to try different things. I would think this is pretty standard fare so I'm not sure why I can't...
3
by: eholz1 | last post by:
Hello PHP Group, I am having trouble setting permissions correctly so that the magickwand api (php 5.2) can read and write images. I usually read a file from one directory, create a magickwand...
1
by: dsudhakara | last post by:
In my queues.conf file my text message are stored here .I want to retrieve particular campaign modify some words in particular campaign and return to save the same queues.conf file .Plz give me...
2
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi Is there any way to Read an INIFile from a string or Stream instead of a physical file ??? I want to read the INIFile into a string then store in a db but when I read the string from the...
3
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I'm creating an application that will read emails from GMail, using the System.Net.Sockets.TcpClient and POP protocol. However, I am having a problem with my SslStream. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.