Jump to content

Save variables

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1
Guest_yoda855_*

Guest_yoda855_*
  • Guests
i'm using Microsoft Visual Basic 2005 express edition. how do i save user changed variables so that they will retain there values the next time the program is run

#2
smith

smith

    Programmer

  • Members
  • PipPipPipPip
  • 153 posts
You can save them in the registry or in an XML file (or dat file or whatever you choose). I generally stick them in the registry but I think the "new" way is XML files.

Here are two topics about it:
http://forum.codecal...highlight=store
http://forum.codecal...highlight=store

for (int i;;) {

   cout << "Smith";

}


#3
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well I use files with my extension for example "file.123" or "file.tcm" well the disadvantage is that they can be edited with a normal text editor ( like Notepad ) UNLESS you encrypt the file to save the settings and unencrypt the file to load the settings ( well just make a basic encryptor in your programm ) that will encrypt/decrypt on save/load !
Perhaps once I will make a Tutorial about this but its a bit complicated I think!

#4
brackett

brackett

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts

Tcm9669 said:

Well I use files with my extension for example "file.123" or "file.tcm" well the disadvantage is that they can be edited with a normal text editor ( like Notepad ) UNLESS you encrypt the file to save the settings and unencrypt the file to load the settings ( well just make a basic encryptor in your programm ) that will encrypt/decrypt on save/load !
Perhaps once I will make a Tutorial about this but its a bit complicated I think!

In .NET, you could use binary serialization. It's not necessarily opaque as encryption, as strings will remain, but it's enough to discourage casual editing.

#5
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well but this guy is using VB 2005! not .NET!

#6
brackett

brackett

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts

Tcm9669 said:

Well but this guy is using VB 2005! not .NET!

Uh, VB 2005 *is* VB.NET. .NET 2.0, to be exact.

#7
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
umm Really?
Sry then! Well coz I just use VB 6.0, so I dont know about other VB Versions, Sry!

EDIT:-
I found a site ( http://www.add-in-express.com/ )and said this:-

ADX Extensions™
for Outlook, .net & VCL
Embed your forms into custom Outlook views and Outlook forms

Visual Studio 2003
Visual Studio 2005
Visual Basic .NET, C# <------VB .NET
Express - VB 2005 , C# 2005 <------VB 2005 Express! (this guy is using this)
RemObjects Chrome 1.5
Borland Delphi 5, 6, 7
Borland Delphi 2005 and 2006

So you see I dont think they are the same!

#8
brackett

brackett

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Just to clarify: Visual Studio 2005, and Visual Basic Express 2005 are *not* the same. Visual Basic Express 2005 is basically a subset of Visual Studio 2005. It can't host addins, edit C# code, etc.

However (and this is the important bit), both Visual Studio and Visual Basic Express are simply IDEs that target the Visual Basic.NET compiler (vbc.exe) and the .NET Framework. You could use notepad to write VB.NET code, and compile it with the command line vbc.exe compiler, and you'll still be targeting the same framework.

So, even though VS 2005 and VB Express 2005 are different IDEs, they write to the same .NET 2.0 compiler - so you can use binary serialization in either one.

#9
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Owww, Ok now I understood. Sorry but I just saw that they were not the same IDE so I tought that VB 2005 Xpress was not .NET but now thanks to your explanation I understood!
Thank you alot!
Regards
Tcm9669

#10
Frantic

Frantic

    Learning Programmer

  • Members
  • PipPipPip
  • 91 posts
I assumed they were the same thing. What other differences are there?