Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 21st, 2005, 01:37 AM
mp mp is offline
Registered User
Join Date: Mar 2005
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default where to put startup txt files

I have deployed my first program using vb.net. I wrote a flat text file for startup preferences and populating startup comboboxes and included these txt files in the bin. I don't wish to use a database in this program. Sometimes the program seems to find the startup file(s) and sometimes it can't. The location is different, where it can't find the files, depending on whether I check the "just for me" option or "everyone" option that is on the initial install screen. I have changed the alwayscreate option in the projectoutput to true. But still having problems "unable to find file." If I manually place the files where it says the files are missing, then the program works. I am using the standard version and have no setup wizard so I am using the setup project for deployment. Any help is greatly appreciated.

Reply With Quote
  #2 (permalink)  
Old March 21st, 2005, 10:22 AM
Friend of Wrox
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts

You can use Application.StartupPath within your program. For example, add a folder called "Startup" and place the text file within it.

Then within your applicaton you can specify the location by:

Application.StartupPath & "\Startup\startupfile.txt"

Replace "startupfile.txt" with the name of your file.

Reply With Quote
  #3 (permalink)  
Old March 24th, 2005, 09:34 AM
mp mp is offline
Registered User
Join Date: Mar 2005
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for this. While I had tried that, I thought that data files had to be in the bin and were automatically deployed from there. Apparently during debugging they are accessed there, but in deployment they are accessed from somewhere under the setup dependencies. When you put the data files under application, then this is done automatically. So you must remove the other files from the bin to avoid duplicate files? Anyways things are working out fine. Thank you.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
WHERE IS THE TXT FILES OF BOOK? PedroPN BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 2 July 5th, 2007 10:32 AM
Uploading txt files arnabghosh Classic ASP Basics 1 June 15th, 2005 04:44 PM
data from txt files to access db citizen99 Access VBA 3 January 25th, 2005 12:50 PM
Working with .txt files ArtDecade VB How-To 2 September 10th, 2004 10:05 PM
Linked Tables to non *.TXT files chrislepingwell Access 0 July 21st, 2004 07:05 AM

All times are GMT -4. The time now is 06:29 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.