473,799 Members | 3,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remember Previous Settings for an Application

Mel
What is the best method to achieve this (I am relatively new to
vb.net)? Should I use an ini file or the registry? Is there another
option available in vb.net that is the preferred way? This
application will reside on our network and more than one user could
possibly run it so I don't think the local registry is the answer.
Basically I just want to remember the options the last user chose on
the form and then use those previously used settings the next time the
program is run.
Aug 19 '08 #1
18 1449
On Aug 19, 11:26*am, Mel <MLights...@gma il.comwrote:
What is the best method to achieve this (I am relatively new to
vb.net)? *Should I use an ini file or the registry? *Is there another
option available in vb.net that is the preferred way? *This
application will reside on our network and more than one user could
possibly run it so I don't think the local registry is the answer.
Basically I just want to remember the options the last user chose on
the form and then use those previously used settings the next time the
program is run.
I would use and XML file personally.

Also, be warned that running .NET apps from the network will give you
a lot of headaches at deployment. Do yourself a favor now and start
learning how to do it (write a simple app and deploy it to your
network, then you'll see the errors I'm referring to).

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Aug 19 '08 #2
Hi Seth,

>Also, be warned that running .NET apps from the network will give you
a lot of headaches at deployment. Do yourself a favor now and start
learning how to do it (write a simple app and deploy it to your
network, then you'll see the errors I'm referring to).

I thought a lot of that was fixed with recent 3.5 SP1 ?

Aug 19 '08 #3
Mel
On Aug 19, 10:40 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
On Aug 19, 11:26 am, Mel <MLights...@gma il.comwrote:
What is the best method to achieve this (I am relatively new to
vb.net)? Should I use an ini file or the registry? Is there another
option available in vb.net that is the preferred way? This
application will reside on our network and more than one user could
possibly run it so I don't think the local registry is the answer.
Basically I just want to remember the options the last user chose on
the form and then use those previously used settings the next time the
program is run.

I would use and XML file personally.

Also, be warned that running .NET apps from the network will give you
a lot of headaches at deployment. Do yourself a favor now and start
learning how to do it (write a simple app and deploy it to your
network, then you'll see the errors I'm referring to).

Thanks,

Seth Rowe [MVP]http://sethrowe.blogsp ot.com/
Okay, I'll look into using an XML file. Thank you for the tip. I'll
search Google for instructions on how to do that.

We have a "Source Code" folder on our file server where we store all
the source code and the executable. Then any of the developers can
modify the program code or run the executable from this location.
This particular vb.net app won't actually be installed anywhere. It
is intended to just be used by the development team to easily manage/
update one of our databases.
Aug 19 '08 #4
I thought a lot of that was fixed with recent 3.5 SP1 ?

Not sure - I hope it was.

I've been in the web-world only for quite a while now so I haven't
been keeping up to speed on Window's application deployment methods.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/

Aug 19 '08 #5
Hi Seth,

"rowe_newsgroup s" <ro********@yah oo.comwrote in message
news:60******** *************** ***********@m45 g2000hsb.google groups.com...
>I thought a lot of that was fixed with recent 3.5 SP1 ?

Not sure - I hope it was.

I've been in the web-world only for quite a while now so I haven't
been keeping up to speed on Window's application deployment methods.
I haven't tested it, but did read these entries :

http://blogs.msdn.com/shawnfa/archiv...lintranet.aspx

http://blogs.msdn.com/vancem/archive...ork-share.aspx

So it looks good/better ;)


Aug 19 '08 #6
On Aug 19, 1:18*pm, "Bill McCarthy" <B...@localhost .comwrote:
Hi Seth,

"rowe_newsgroup s" <rowe_em...@yah oo.comwrote in message

news:60******** *************** ***********@m45 g2000hsb.google groups.com...
I thought a lot of that was fixed with recent 3.5 SP1 ?
Not sure - I hope it was.
I've been in the web-world only for quite a while now so I haven't
been keeping up to speed on Window's application deployment methods.

I haven't tested it, but did read these entries :

http://blogs.msdn.com/shawnfa/archiv...ust-on-the-loc...

http://blogs.msdn.com/vancem/archive...mework-3-5-sp1...

So it looks good/better ;)
Ooh, very nice.

If I was still at my old job (where I developed Window's applications)
I would be dancing for joy! Now I just curse under my breath that this
wasn't available before....

:-)

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Aug 19 '08 #7
Mel
On Aug 19, 1:16 pm, rowe_newsgroups <rowe_em...@yah oo.comwrote:
On Aug 19, 1:18 pm, "Bill McCarthy" <B...@localhost .comwrote:
Hi Seth,
"rowe_newsgroup s" <rowe_em...@yah oo.comwrote in message
news:60******** *************** ***********@m45 g2000hsb.google groups.com...
>I thought a lot of that was fixed with recent 3.5 SP1 ?
Not sure - I hope it was.
I've been in the web-world only for quite a while now so I haven't
been keeping up to speed on Window's application deployment methods.
I haven't tested it, but did read these entries :
http://blogs.msdn.com/shawnfa/archiv...ust-on-the-loc...
http://blogs.msdn.com/vancem/archive...mework-3-5-sp1...
So it looks good/better ;)

Ooh, very nice.

If I was still at my old job (where I developed Window's applications)
I would be dancing for joy! Now I just curse under my breath that this
wasn't available before....

:-)

Thanks,

Seth Rowe [MVP]http://sethrowe.blogsp ot.com/
Anyone have a good link to an article that explains to how to read/
write to an XML file from VB.net? I only need to remember 3 darn
settings...
Aug 19 '08 #8
Hi Mel,

"Mel" <ML********@gma il.comwrote in message
news:1c******** *************** ***********@e53 g2000hsa.google groups.com...
>
Anyone have a good link to an article that explains to how to read/
write to an XML file from VB.net? I only need to remember 3 darn
settings...
Are the settings for all users or per user ? If the later then use
My.SEttigns and the settings designer.

If for all users, and you are using VB 2008, use XDocument, e.g:

To read:
Dim doc As XDocument = XDocument.Load( "settings.x ml")
Dim setting1 As String = doc...<setting1 >.Value
Dim setting2 As String = doc...<setting2 >.Value
Dim setting3 As String = doc...<setting3 >.Value

To Write:

Dim doc = <?xml version="1.0"?>
<settings>
<setting1>top secret key</setting1>
<setting2>my credit card number</setting2>
<setting3>my social security number</setting3>
</settings>
doc.Save("setti ngs.xml")
Or using placeholders:
Dim doc = <?xml version="1.0"?>
<settings>
<setting1><%= setting1 %></setting1>
<setting2><%= setting2 %></setting2>
<setting3><%= setting3 %></setting3>
</settings>



Aug 19 '08 #9
Mel
On Aug 19, 2:17 pm, "Bill McCarthy" <B...@localhost .comwrote:
Hi Mel,

"Mel" <MLights...@gma il.comwrote in message

news:1c******** *************** ***********@e53 g2000hsa.google groups.com...
Anyone have a good link to an article that explains to how to read/
write to an XML file from VB.net? I only need to remember 3 darn
settings...

Are the settings for all users or per user ? If the later then use
My.SEttigns and the settings designer.

If for all users, and you are using VB 2008, use XDocument, e.g:

To read:

Dim doc As XDocument = XDocument.Load( "settings.x ml")
Dim setting1 As String = doc...<setting1 >.Value
Dim setting2 As String = doc...<setting2 >.Value
Dim setting3 As String = doc...<setting3 >.Value

To Write:

Dim doc = <?xml version="1.0"?>
<settings>
<setting1>top secret key</setting1>
<setting2>my credit card number</setting2>
<setting3>my social security number</setting3>
</settings>

doc.Save("setti ngs.xml")

Or using placeholders:

Dim doc = <?xml version="1.0"?>
<settings>
<setting1><%= setting1 %></setting1>
<setting2><%= setting2 %></setting2>
<setting3><%= setting3 %></setting3>
</settings>
All users. I just wanted to remember the last settings used,
regardless of who did it. Thanks, I will check out your code example
and give it a whirl.
Aug 19 '08 #10

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

Similar topics

9
5318
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of copy paste (I hear this will improve in ASP.Net 2 via master pages). When I navigate from one page to the next the header and footer user controls lose their state because they are effectively different instances of the user control. Is there...
2
2417
by: theWizard1 | last post by:
Using Visual Studio.Net 2005, Asp.Net 2.0, and trying to use technique shown in the Programming Asp.Net 3rd Edition by O'Reily, page 257. On the first page, this would become the previous page, I have 2 dropdowns. According to their technique, I should create a public property on my previous page for these 2 dropdowns, and then I would would be able to get their settings on the target aspx page. I have added the 2 properties on the...
10
2536
by: WT | last post by:
Hello, I have been publishing my web site many times to the remote where resides my final web site. Everything was ok, but to-day, without any configuration change, vs doesn't copy final files to the remote site. It finish with a message of publish sucess but no files nor folders on the remote disk ? I have checked rights on this folder, everyone have modify.
10
4281
by: Paul Cheetham | last post by:
Hi, I am developing an application that needs to store some machine-specific settings. The application is going to be published on the network in order to keep the clients on the latest version. Because of this, I am unable to store these settings in the App.Config file, as this gets updated every time the application does, and there doesn't appear to be a way of preventing this. Most of my application settings are kept in the...
10
3061
by: Chris Dunaway | last post by:
I have an .exe console project and a class library project as part of a solution. The .exe has an App.config file and I have used the Settings page to add some Application level settings. When I try to retrieve a setting using this code: //Method 1 string s = ConfigurationManager.AppSettings;
1
8144
by: Manikandan | last post by:
Hi, I'm creating a setup project for my c# application(Contains solution, c# project, setup project). In setup project properties, i set removepreviousversion property=true. Created the installer and tested, installed successfully. If i install again means it's asking a dialogue with an option to repair, remove. Now I make some changes in my c# codings and build the installer for the same appliaction.
22
4949
by: cj | last post by:
I was googling for a way to have my single form application start in the same location on the screen it was in when it was closed. I found this very short article: http://blogs.techrepublic.com.com/programming-and-development/?p=540 I can create the my.settings object as specified but I can't set the form1's location to mainformlocation in form1's properties. It takes an X and Y location.
2
1040
by: Mel | last post by:
What is the best method to achieve this (I am relatively new to vb.net)? Should I use an ini file or the registry? Is there another option available in vb.net that is the preferred way? This vb.net application will reside on our network and more than one user could possibly run it so I don't think the local registry is the answer. Basically I just want to remember the options the last user chose on the form and then use those previously...
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10228
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.