473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to access files on a cd using IO.StreamReader

I want to have my program look on the CD drive for the data files
needed to run my program but I can't find any info on this. I am using
a StreamReader to get really simple information from a text file and I
want it to look on the CD Drive. As computers have many drives is
there a way I can have it look on the first CD Drive. When declare it,
it looks like this but I was hoping I could change the file spec. Dim
varReader As IO.StreamReader = IO.File.OpenText("A:\Data.txt") Does
this make sense and does anyone have any ideas about this?

Thanks for the help, Dennis
Nov 20 '05 #1
1 1374
Cor
Hi Dennis,
Take a look at the OpenFileDialog class on MSDN,
After you have found a file with that it becomes something like
varReader As IO.StreamReader = IO.File.OpenText(myOpenFileDialog.file)


I hope it brings you on the route.

Cor
Nov 20 '05 #2

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

Similar topics

2
by: Raed Sawalha | last post by:
Hello , I have windows service which do listening to specified directory using FileSystemWatcher , on Created Event and Get all the files in the directory using Directory.GetFiles function then...
6
by: syed javid | last post by:
hi all, I am getting an error when i process 1 MB txt file using StreamReader and i am reading char by char using streamReader.Read() method at some point it is throwing an exception...
9
by: jeff M via .NET 247 | last post by:
I'm still having problems reading EBCDIC files. Currently itlooks like the lower range (0 to 127) is working. I have triedthe following code pages 20284, 20924, 1140, 37, 500 and 20127.By working I...
6
by: belmontpress | last post by:
I wish to delete some files from a directory after reading them but have the problem that the system says that the files are in use and cannot delete them even though I have set the StreamReader to...
6
by: Sirin Azazi | last post by:
Hi, I wrote simple program to get the .c and .h files in a folder and number of lines they contain. It works; but when i choose the 'c:\' folder, i get an Argument Exception. when i choose...
5
by: AnDrE | last post by:
Hello I'm developing a application in VB .NET 2005 and I need to access text files. I'm using the System.IO.File library and I have this code: Dim oFile As System.IO.File Dim oRead As...
5
by: Justin Fancy | last post by:
Hi everyone, I need some help. I'm placing text files into a created database using vb.Net. The problem is that, i need two seperate sql statements to add both files because they are in...
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
1
by: E11esar | last post by:
Hi there. I have a folder within my asp.net (c#) project in VS2008 called Files. Within this folder is a text file called files.txt. Is there a way to access this folder from the C# code...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.