.ini files
Page 1 of 15 Replies - 5191 Views - Last Post: 31 May 2009 - 06:32 AM
#1
.ini files
Posted 05 August 2008 - 06:28 PM
I am working on a program. I want to use a .ini settings file where the user can set things like admin password and to enable security.
How would I use one of these files with my code.
I know in vb.net you use the settings feature.
Replies To: .ini files
#2
Re: .ini files
Posted 05 August 2008 - 07:58 PM
But as for your question, you have two main options. The first is that you can use API calls from kernel32 like... GetPrivateProfileSectionA(), GetPrivateProfileStringA(), WritePrivateProfileSectionA(), and WritePrivateProfileStringA() or you can build your own (or use someone elses) class file.
The class file might be easier for you since you are first starting out. You can find an instance of such a class at this location...
Reading & Writing to .ini - vb6 - class file included
Hope this helps get you started.
#3
Re: .ini files
Posted 05 August 2008 - 09:12 PM
An INI file doesn't really provide the security you'd need for passwords. Not unless you plan on encrypting them in some way.
As far as INI files go, I've used this class module in several apps and find it's title to be very accurate...
Easy INI File Access
http://www.vbacceler...ess/article.asp
For what it's worth, I still use VB6 100% of the time. The apps I write are based on DLLs and ActiveX Controls we created *years* ago. It would be suicide to our company to attempt to migrate everything to dotNet, especially since there'd be absolutely no benefit.
dotNet is named .Net for a good reason. It's best used for creating web apps. It's still packed with bugs and features that simply don't work. VB6 is the most stable of any language based on BASIC.
The creators of dotNet never even touched "VB" as they all thought it was a "toy". That "toy" help MS become a software giant.
The VB.Net language (people aren't even supposed to call it "VB.Net" anymore... even Microsoft can't decide what to call it) was written by C programmers. Anyone that's written code in C knows that VB and C are *nothing* alike...
You can thank people like Anders Hejlsberg and Paul "I'm the father of Visual Basic" Vick for giving us this mess called VB.Net. I seriously doubt Paul Vick ever had a VB IDE open in his life until self-proclaiming himself "The Father" (what a laugh)
You may be able to tell I'm frustrated by this mess. Since it's an entirely new language, it should have a new name. Simple as that. Unlike all previous versions of BASIC, there's no direct migration path to anything.Net... it's ridiculous to think it's easier to migrate from Quick Basic 4.5 to VB6 than it is to migrate from VB6 to dotNet... the reason is simple. The language designers know nothing about BASIC's history.
So... if you want a truly RAD program development environment, VB6 can't be beat. If you want "glitter and gold" where you're fighting bugs the dotNet guys can't seem to fix (why should they? They're working on VB.Next), go ahead and invest your time/energy in dotNet.
Personally, I'd go with Delphi or any other non-MS language... which frustrates me even further because Delphi (and even COBOL) have dotNet implementations that require very little, if any, code changes... that alone should tell people something about how much MS values your code assets.
#4
Re: .ini files
Posted 06 August 2008 - 08:49 PM
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
I wasn't suggesting that anyone start talking VB.NET here just that they will not want to let VB.NET go to the way side because IT IS dying and has been for the last couple years.
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
Then you have a real problem if your company is using nothing but VB6. It is going to have more and more issues with interaction with things and you will quickly find your company behind the times (if it isn't already).
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
*BEEP* Wrong.... while the framework does bring the old archaic VB into the "internet revolution" with more network objects and libraries, it is still used HEAVILY in windows forms applications. Believe it or not its strength lies in easy to use GUI interfaces which works well with databases. Making VB one of the top choices for database interface design.
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
This is sooooo wrong on so many levels I don't know how to even address it. VB has always been heavily developed by Microsoft and one of the goals of .NET when it was developed was to bring VB.NET up to speed and keep it part of the "family". Lots of people at Microsoft also deal a lot with VB. Also VB contributed little (along with any language) to MS becoming a giant... it was the Window OS and their deal with IBM that made them the giant.
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
I don't know where you heard that it is not to be called VB.NET anymore and often times Microsoft calls it VB.NET or by its full name Visual Basic 2003/2005/2008 etc. And I have no clue why you made the last statement, of course everyone knows that C is nothing like VB. The creators of VB made it that way on purpose. They wanted a language that increased readability and was easier to use and learn.
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
I know VB5/6 and I know VB.NET since 2003 and I can tell you that hands down I like VB.NET way better than 5/6. (Can anyone say DLL hell?) Not to mention VB6 lacked true object oriented principles, had shitty database access like DAO (in the earlier days of the language), and don't forget not having things like access to web services and just poor code organization. Probably the reason that Microsoft dropped support for this last version of the VB6 (1998) language back in February of this year.
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
What the hell are you talking about? The syntax of the language can be traced back to BASIC very easily. It has kept many of the same keywords, classic examples IF condition THEN structure, FOR counter = 0 to N NEXT structure, the use of "AND" and "OR" instead of other languages using && and ||, LEN() came straight from BASIC, same with the functions LEFT, UCASE and STRING not to mention things like the DO LOOP UNTIL has around since then too. If anyone takes a look at some BASIC code they can see the similarities right away.
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
VB6 is outdated man. Try finding even resources on MSDN for it and you will have to dig a bit (again discontinued as of February 2008). I have helped companies migrate from VB6 to .NET because they were having problems keeping VB6 code afloat. Try doing a search on Google with just "Visual Basic" and tell me how many VB 6 results you find compared to .NET. Not to mention VB6 is a hell of a lot buggier than VB.NET. Oh wait, that reminds me VB6 didn't even have very good error trapping either. So it couldn't even effectively catch all the errors when it has them. I really don't know where you are getting your facts, truly.
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
Well I don't think Delphi is any much better but if you are looking for cross platform compatibility sure go with a non-MS language because everyone knows that they got you locked in to Windows. And with anything that you add to you are going to eventually need to change some code. non-MS languages are not immune to having to change code just to keep it up to date. This is typically called "code rot" and even things that were fine back in the earlier versions of Java now throws warnings to put in error catching for exceptions for more modern versions. Everything changes, it is the nature of technology.
In short, take what this reader has said with a grain of salt. I have pointed out that a large portion of what they have said is not quite true or in some cases just dead wrong. I typically don't flame people this bad but when they go around spreading such blatant lies and misinformation, I feel it my duty to step in and correct it.
To reiterate what I had said at the top, I didn't say just drop VB6 altogether, but just keep in mind that a LARGE portion of the industry has already moved on to .NET and never stop practicing with it.
#5
Re: .ini files
Posted 11 August 2008 - 02:39 PM
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
I wasn't suggesting that anyone start talking VB.NET here just that they will not want to let VB.NET go to the way side because IT IS dying and has been for the last couple years.
here, you're right. VB.net is dying, and has been for the past couple years
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
Then you have a real problem if your company is using nothing but VB6. It is going to have more and more issues with interaction with things and you will quickly find your company behind the times (if it isn't already).
most of those interaction problems can be worked around. one of the many great things about VB6 is that you can create and modify components(if you know how)
[quote name='Martyr2' date='6 Aug, 2008 - 08:49 PM' post='396158']
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
*BEEP* Wrong.... while the framework does bring the old archaic VB into the "internet revolution" with more network objects and libraries, it is still used HEAVILY in windows forms applications. Believe it or not its strength lies in easy to use GUI interfaces which works well with databases. Making VB one of the top choices for database interface design.
[/qoute]
granted, .net does have a fuller GUI, but the graphics needed to display everything uses much more ram space than VB6 and causes development times to be slower if there isn't sufficient ram. not only that, but most of the properties in .net are things that either shouldn't be messed with, or were already in VB6(there are a few exceptions, but not many)
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
This is sooooo wrong on so many levels I don't know how to even address it. VB has always been heavily developed by Microsoft and one of the goals of .NET when it was developed was to bring VB.NET up to speed and keep it part of the "family". Lots of people at Microsoft also deal a lot with VB. Also VB contributed little (along with any language) to MS becoming a giant... it was the Window OS and their deal with IBM that made them the giant.
the reason windows OS was such a success, was that it was easy to create applications for it, and design your own custom applications if their weren't any out that suited your needs. and let me think... what made it so easy to create applications? I think it was the earlier forms of VB.
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
I don't know where you heard that it is not to be called VB.NET anymore and often times Microsoft calls it VB.NET or by its full name Visual Basic 2003/2005/2008 etc. And I have no clue why you made the last statement, of course everyone knows that C is nothing like VB. The creators of VB made it that way on purpose. They wanted a language that increased readability and was easier to use and learn.
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
I know VB5/6 and I know VB.NET since 2003 and I can tell you that hands down I like VB.NET way better than 5/6. (Can anyone say DLL hell?) Not to mention VB6 lacked true object oriented principles, had shitty database access like DAO (in the earlier days of the language), and don't forget not having things like access to web services and just poor code organization. Probably the reason that Microsoft dropped support for this last version of the VB6 (1998) language back in February of this year.
poor code organization? the way I was taught, programmers should organize the code themselves. if you cram papers into a binder, the binder won't sort them for you, so why should VB sort out code that you cram into it? programming should take effort, not just random typing to get your result.
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
What the hell are you talking about? The syntax of the language can be traced back to BASIC very easily. It has kept many of the same keywords, classic examples IF condition THEN structure, FOR counter = 0 to N NEXT structure, the use of "AND" and "OR" instead of other languages using && and ||, LEN() came straight from BASIC, same with the functions LEFT, UCASE and STRING not to mention things like the DO LOOP UNTIL has around since then too. If anyone takes a look at some BASIC code they can see the similarities right away.
there are some similarities in the way the code is presented, and in the functions. but the syntax has changed quite a lot, and much more of the code seems more complex to the average user. plus, their is so much garbage in .net, for instance, right in the private sub declarations, it needs to fill the (parenthesis) with data like integers, that serves no purpose, and wastes code space.
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
VB6 is outdated man. Try finding even resources on MSDN for it and you will have to dig a bit (again discontinued as of February 2008). I have helped companies migrate from VB6 to .NET because they were having problems keeping VB6 code afloat. Try doing a search on Google with just "Visual Basic" and tell me how many VB 6 results you find compared to .NET. Not to mention VB6 is a hell of a lot buggier than VB.NET. Oh wait, that reminds me VB6 didn't even have very good error trapping either. So it couldn't even effectively catch all the errors when it has them. I really don't know where you are getting your facts, truly.
the reason there are so many google results for .net is that people can't understand .net code. people need help with it. they seek, and google finds. people could understand VB6 and as such, didn't need to ask for help as much.
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
Ken Halter, on 5 Aug, 2008 - 09:12 PM, said:
Well I don't think Delphi is any much better but if you are looking for cross platform compatibility sure go with a non-MS language because everyone knows that they got you locked in to Windows.
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
well, Java's not my field, but old code from earlier versions of Java shouldn't need a half hour minimum of work to bring it up to date. unlike the transition from VB6 to .net.
and going backwards is difficult. having code in .net that you want to compile in VB6 takes quite a bit of work.
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
most of the original post was correct, if it was buried a bit, that's just grammar errors. but the message was true.
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
well, VB6 is what they teach in schools, so industries that have switched over might be a bit disappointed.
the only real benefit to .net is that you can legally obtain it for free, right from Microsoft, and that really doesn't help much(seeing as you can't compile exe's with it).
edit:why aren't my quotes in quotes?
This post has been edited by jakerman999: 11 August 2008 - 02:46 PM
#6
Re: .ini files
Posted 31 May 2009 - 06:32 AM
Martyr2, on 6 Aug, 2008 - 08:49 PM, said:
|
|

New Topic/Question
Reply




MultiQuote




|