Re: VB.NET - Could not find a part of the path ?

M

M. Zeeshan Mustafa

Abdullah,

AFAIK FileOpen is from Microsoft.VisualBasic namespace and it does
not support a filepath which is a UNC share.

You can use System.IO.StreamReader which supports unc shares.
Also I tried with a mapped drive and named it "F" and when I do
F:\NOVA\ESI\SCAN.TXT it doesn't work either !

what exception does it throw? I think this is because of same problem
because F: is _actually_ \\16.12.4.70\NOVA\ESI\SCAN.TXT

--
Hope this helps,
Zeeshan Mustafa, MCSD


Abdullah Haroon Imam said:
Hi,

I have developed a ASP.NET web application with VB.NET using VS.NET 2003
and am trying to do the following.
FileOpen(fn1, "\\16.12.4.70\NOVA\ESI\SCAN.TXT", OpenMode.Input,
OpenAccess.Read, OpenShare.Shared)
and it's not working and I get the following error

Run-time exception thrown : System.IO.DirectoryNotFoundException - Could not find
a part of the path "C:\WINDOWS\system32\16.12.4.70\NOVA\ESI\SCAN.TXT".

Why is it looking under C:\WINDOWS\system32\ ???

Also I tried with a mapped drive and named it "F" and when I do
F:\NOVA\ESI\SCAN.TXT it doesn't work either !
 
M

M. Zeeshan Mustafa

Haroon,

Application cannot access path "\\esi" or "\\16.12.4.70" as
it clearly says in exception "The network name cannot be found."

A solution would be to check manually if you can access
these paths, or check if there is some kind of a firewall blocking
access to that path.

--
Hope this helps,
Zeeshan Mustafa, MCSD


Abdullah Haroon Imam said:
Zeeshan,

Thanks for the reply. I tried the following

Dim file As New System.IO.StreamReader("F:\NOVAF\ESIRPT\SCANINF1.TXT")
Error I got : System.IO.DirectoryNotFoundException: Could not find a part
of the path "F:\NOVAF\ESIRPT\SCANINF1.TXT".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top