|
-
Aug 30th, 2005, 02:23 PM
#1
Thread Starter
New Member
processing file that user selects with OpenFile
I am still quite new to VB.NET and I have a problem with setting up an application that will allow a user to select a txt file for the program to process. I have the basics, such as the program asking the user to browse and select a file and then having it write out the name of the file they have selected preceded by the path of its location.
Now from here, I need to be able to click on another button and have it utilize the selected file to process queries, such as a file of a list of hostnames. I am sure I will have to set up global variables but they have been confusing me a bit. I am sure as long as I can get one sub to recognize a variable in another sub, I will be fine.
can anyone help me with this? let me know if you need an snippet of code.
Aaron
-
Aug 30th, 2005, 03:04 PM
#2
Addicted Member
Re: processing file that user selects with OpenFile
Your trying to load txt files with sql commands in them?
-
Aug 30th, 2005, 03:20 PM
#3
Re: processing file that user selects with OpenFile
you don't need globals.. just pass the string around that contains the file path\name and have individual functions handle the processing. for example, you said you can show the file open dialog, so now you have the name of the file in a string variable... you can just make a function/sub called ProcessFile that would look something like this
VB Code:
Public Function ProcessFile(FileName as string) As boolean 'or whatever return value you want to use
'process the file in here, the file is held in variable FileName
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|