473,396 Members | 1,998 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.

Creating INI file

Hi,

How do I create/access an INI file in VB .NET? I
appreciate any help you can give me...

Thanks!
Nov 20 '05 #1
13 4072
* "Grace" <an*******@discussions.microsoft.com> scripsit:
How do I create/access an INI file in VB .NET? I
appreciate any help you can give me...


INI files are out of date.

<http://www.mentalis.org/soft/class.qpx?id=6>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
It's true that INI files are out of date; nonetheless, people still need to
read and write legacy INI files--and Microsoft still uses INI files
extensively in its own programs. You can find more information here:
http://www.devx.com/dotnet/Article/7008

And for the .NET way:
http://www.devx.com/dotnet/Article/16927

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bp*************@ID-208219.news.uni-berlin.de...
* "Grace" <an*******@discussions.microsoft.com> scripsit:
How do I create/access an INI file in VB .NET? I
appreciate any help you can give me...


INI files are out of date.

<http://www.mentalis.org/soft/class.qpx?id=6>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
"Grace" <an*******@discussions.microsoft.com> schrieb

How do I create/access an INI file in VB .NET? I
appreciate any help you can give me...


Have a look at the Get* and Write* functions:
http://msdn.microsoft.com/library/en..._functions.asp
BTW, INI files are said to be obsolete:

<quote>
Note This function is provided only for compatibility with 16-bit
Windows-based applications, therefore this function should not be called
from server code. Applications should store initialization information in
the registry
</quote>
How to use pinvoke:
http://msdn.microsoft.com/library/en...lfunctions.asp
http://msdn.microsoft.com/library/en...indowsAPIs.asp

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

"Grace" <an*******@discussions.microsoft.com> wrote in message
news:0c****************************@phx.gbl...
Hi,

How do I create/access an INI file in VB .NET? I
appreciate any help you can give me...

Thanks!


Yes, INI files are out of date. But two facts here, let me point out
desktop.ini that still exists in WinXP. Also, INI files are a lot smaller
than thier XML replacements. I am thinking of switching over to XML myself
just because of the added features that XML offers. Also, alot of people
say "Use the registry". I've never been a huge fan of that, plus, I'm
testing out the Mono system, and I don't even want to think about the
nightmares WINE and MONO will have witha psudo-registry, so I'm staying
file-based.
There are alot of options, but it comes down to personal preference, and
no one should jump down anyone else's case for doing a personal preference.
My suggestion Grace, if you want to still use legacy INI files, use the
same API calls that VB6 would use, they work just fine. If you want to
stick with file-based user settings, look into XML files, the offer so much
more than a flat INI file would, but once again, it's personal preference.

HTH
Suefell
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
Nov 20 '05 #5
On 2003-11-21, Sueffel <so*****@somewhere.com> wrote:

"Grace" <an*******@discussions.microsoft.com> wrote in message
news:0c****************************@phx.gbl...
Hi,

How do I create/access an INI file in VB .NET? I
appreciate any help you can give me...

Thanks!


Yes, INI files are out of date. But two facts here, let me point out
desktop.ini that still exists in WinXP. Also, INI files are a lot smaller
than thier XML replacements. I am thinking of switching over to XML myself
just because of the added features that XML offers. Also, alot of people
say "Use the registry". I've never been a huge fan of that, plus, I'm
testing out the Mono system, and I don't even want to think about the
nightmares WINE and MONO will have witha psudo-registry, so I'm staying
file-based.


Mono is comming along very nicely... I'm currently working on a C#
wrapper for then libncurses.so on my Gentoo Linux box. I think if one
wants to stay as portable as possible, then XML based config files is
the best way to go. Using legacy INI API calls just complicates things
if you ever have to port.

And for those that don't know - VB.NET will run on Mono, though the mono
basic compiler (mbas) is not as complete as the C# compiler currently.

--
Tom Shelton
[MVP - Visual Basic]
Nov 20 '05 #6

"Tom Shelton" <to*@lsnfcdm.com> wrote in message
news:#z**************@TK2MSFTNGP11.phx.gbl...
On 2003-11-21, Sueffel <so*****@somewhere.com> wrote:

"Grace" <an*******@discussions.microsoft.com> wrote in message
news:0c****************************@phx.gbl...
Hi,

How do I create/access an INI file in VB .NET? I
appreciate any help you can give me...

Thanks!


Yes, INI files are out of date. But two facts here, let me point out desktop.ini that still exists in WinXP. Also, INI files are a lot smaller than thier XML replacements. I am thinking of switching over to XML myself just because of the added features that XML offers. Also, alot of people say "Use the registry". I've never been a huge fan of that, plus, I'm
testing out the Mono system, and I don't even want to think about the
nightmares WINE and MONO will have witha psudo-registry, so I'm staying
file-based.


Mono is comming along very nicely... I'm currently working on a C#
wrapper for then libncurses.so on my Gentoo Linux box. I think if one
wants to stay as portable as possible, then XML based config files is
the best way to go. Using legacy INI API calls just complicates things
if you ever have to port.

And for those that don't know - VB.NET will run on Mono, though the mono
basic compiler (mbas) is not as complete as the C# compiler currently.

--
Tom Shelton
[MVP - Visual Basic]


Good to hear that Mono's running, I have not as yet been able to get it
to install. I'm running SuSE 8.1 on a VMWare, and the problem I'm having
now is I had to install pkg-config, and now it's griping it can't find the
variable and glib-2.0 Fun LMAO
I really want to test out the mono-mod for Apache, that looks nifty to
say the least.

Suefell
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
Nov 20 '05 #7
On 2003-11-21, Sueffel <so*****@somewhere.com> wrote:

"Tom Shelton" <to*@lsnfcdm.com> wrote in message
news:#z**************@TK2MSFTNGP11.phx.gbl...
On 2003-11-21, Sueffel <so*****@somewhere.com> wrote:
>
> "Grace" <an*******@discussions.microsoft.com> wrote in message
> news:0c****************************@phx.gbl...
>> Hi,
>>

<snip>
--
Tom Shelton
[MVP - Visual Basic]


Good to hear that Mono's running, I have not as yet been able to get it
to install. I'm running SuSE 8.1 on a VMWare, and the problem I'm having
now is I had to install pkg-config, and now it's griping it can't find the
variable and glib-2.0 Fun LMAO
I really want to test out the mono-mod for Apache, that looks nifty to
say the least.

Suefell


The ASP.NET implementation does look interesting, but I'm not normally a
web guy (at least not anymore - and when I was, I was doing CGI with
Perl). What I have been playing with is GTK# and now I'm using a lot of
P/Invoke to wrap the ncurses library.

If it's not to much trouble, I would switch distros. I had it running
on RH9 with not to much trouble and getting it running on Gentoo was
even easier:

emerge mono gtk-sharp

All done :) Mono is a really neat system. I hope that it doesn't
suffer a legal demise do to the MS patents on the .NET api.

--
Tom Shelton
[MVP - Visual Basic]
Nov 20 '05 #8

"Tom Shelton" <to*@lsnfcdm.com> wrote in message
news:ON**************@TK2MSFTNGP10.phx.gbl...
On 2003-11-21, Sueffel <so*****@somewhere.com> wrote:

"Tom Shelton" <to*@lsnfcdm.com> wrote in message
news:#z**************@TK2MSFTNGP11.phx.gbl...
On 2003-11-21, Sueffel <so*****@somewhere.com> wrote:
>
> "Grace" <an*******@discussions.microsoft.com> wrote in message
> news:0c****************************@phx.gbl...
>> Hi,
>>
<snip>
--
Tom Shelton
[MVP - Visual Basic]


Good to hear that Mono's running, I have not as yet been able to get it to install. I'm running SuSE 8.1 on a VMWare, and the problem I'm having now is I had to install pkg-config, and now it's griping it can't find the variable and glib-2.0 Fun LMAO
I really want to test out the mono-mod for Apache, that looks nifty to say the least.

Suefell


The ASP.NET implementation does look interesting, but I'm not normally a
web guy (at least not anymore - and when I was, I was doing CGI with
Perl). What I have been playing with is GTK# and now I'm using a lot of
P/Invoke to wrap the ncurses library.

If it's not to much trouble, I would switch distros. I had it running
on RH9 with not to much trouble and getting it running on Gentoo was
even easier:

emerge mono gtk-sharp

All done :) Mono is a really neat system. I hope that it doesn't
suffer a legal demise do to the MS patents on the .NET api.

--
Tom Shelton
[MVP - Visual Basic]


I really doubt they will because from my research, the CLR does not fall
under the .NET patent, because it was created by someone else and remains
opensource, so does C# technically, although MS bought the rights to it.
This is all from research, so it may be partially conjecture. It may come
down to be similar to the situation between Linux and Sun Microsystems, so
it's hard to tell.
Hope it sticks around, because even if Linux get's a major foothold on
the market, it will allow MS to continue to be a big player in the field of
programming architecture.

Suefell
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
Nov 20 '05 #9
* Tom Shelton <to*@lsnfcdm.com> scripsit:
desktop.ini that still exists in WinXP. Also, INI files are a lot smaller
than thier XML replacements. I am thinking of switching over to XML myself
just because of the added features that XML offers. Also, alot of people
say "Use the registry". I've never been a huge fan of that, plus, I'm
testing out the Mono system, and I don't even want to think about the
nightmares WINE and MONO will have witha psudo-registry, so I'm staying
file-based.


Mono is comming along very nicely... I'm currently working on a C#
wrapper for then libncurses.so on my Gentoo Linux box. I think if one
wants to stay as portable as possible, then XML based config files is
the best way to go. Using legacy INI API calls just complicates things
if you ever have to port.


It's time that somebody provides a _managed_ implementation of Window's
INI file access...

SCNR

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #10
On 2003-11-21, Herfried K. Wagner [MVP] <hi***************@gmx.at> wrote:
* Tom Shelton <to*@lsnfcdm.com> scripsit:
desktop.ini that still exists in WinXP. Also, INI files are a lot smaller
than thier XML replacements. I am thinking of switching over to XML myself
just because of the added features that XML offers. Also, alot of people
say "Use the registry". I've never been a huge fan of that, plus, I'm
testing out the Mono system, and I don't even want to think about the
nightmares WINE and MONO will have witha psudo-registry, so I'm staying
file-based.


Mono is comming along very nicely... I'm currently working on a C#
wrapper for then libncurses.so on my Gentoo Linux box. I think if one
wants to stay as portable as possible, then XML based config files is
the best way to go. Using legacy INI API calls just complicates things
if you ever have to port.


It's time that somebody provides a _managed_ implementation of Window's
INI file access...

SCNR


Sounds like a good idea... When can I expect you to have that done? :)

--
Tom Shelton
[MVP - Visual Basic]
Nov 20 '05 #11
I have created a small wrapper class around INI files (for compatibility
with older applications).

Have a look at http://www.utmag.com/May2003/Page59.asp

--
HTH

Éric Moreau, MCT, MCSD
Conseiller principal / Senior consultant
Concept S2i inc. (www.s2i.com)

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e%****************@TK2MSFTNGP12.phx.gbl...
* Tom Shelton <to*@lsnfcdm.com> scripsit:
desktop.ini that still exists in WinXP. Also, INI files are a lot smaller than thier XML replacements. I am thinking of switching over to XML myself just because of the added features that XML offers. Also, alot of people say "Use the registry". I've never been a huge fan of that, plus, I'm
testing out the Mono system, and I don't even want to think about the
nightmares WINE and MONO will have witha psudo-registry, so I'm staying file-based.


Mono is comming along very nicely... I'm currently working on a C#
wrapper for then libncurses.so on my Gentoo Linux box. I think if one
wants to stay as portable as possible, then XML based config files is
the best way to go. Using legacy INI API calls just complicates things
if you ever have to port.


It's time that somebody provides a _managed_ implementation of Window's
INI file access...

SCNR

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #12
* "Éric Moreau" <_N******************@videotron.ca> scripsit:
I have created a small wrapper class around INI files (for compatibility
with older applications).

Have a look at http://www.utmag.com/May2003/Page59.asp


I was talking about a completely managed re-implementation of the
Windows p/invoke calls which can be easily ported to other platforms
that don't support the Windows API.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #13

"Herfried K. Wagner [MVP]" <hirf-spam-me-
<SNIP>

Well, I'm working on a class that uses .cfx files. Basically, they are
XML implimentation of INI files, which provide the ability to have multiple
value for each key. I would love nothing more than to make this an API, but
that's not possible with VB.NET, or so I'm told. But, with it being a
class, I can shove that into a DLL, and then the Win32 API compatability is
no longer an issue, and it can be used under Mono/WinRack which has issues
with Windows Registry, or it could be used on Mac which has no registry.
Check back with me on my progress...

Sueffel
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
Nov 20 '05 #14

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

Similar topics

6
by: Jeremy Langworthy | last post by:
Hi I am trying to create a MS Excel format CSV but I can't figure out how to get the line feed/carriage return/new record working properly. I am nding each line/record with these characters:...
1
by: Inpreet | last post by:
Hello I am using: ************************************************************************* header("Content-Type:application/force-download",false); header("Content-Disposition: attachment;...
1
by: dave | last post by:
I first started using HCW.exe to compile .rtf filew created with MS Word a couple of weeks ago. I used the file | new menu then selected New project in the dialog box and everything worked as...
1
by: C-man | last post by:
Basically I have this little program that will look through directories and rename any file it finds. The renaming that takes place is like removing of dashes or Caps the first letter from each...
2
by: George Marsaglia | last post by:
I have a set of, say, 2000 points in the 8-dimensional simplex S={(x_1,x_2,...,x_8),x_1+x_2+...+x_8=1, x's>=0}. To help analyze that 8-dimensional set, I wish to project the set of points onto...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
1
by: MT | last post by:
We have a .NET dll that we are deploying to our customers using a deployment project in VS .NET 2003. There is a lot of information about creating publisher policies on the web, but we have not...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
5
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.