Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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.

 
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
Default

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.

J
 
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
Default

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.

Mike





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





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