473,386 Members | 1,860 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,386 software developers and data experts.

Using DirectoryInfo Class

I am trying to use the DirectoryInfo class to create links on a web page to
files in the specified directory. I can get it to work just fine. The
problem I am having is when I try to put in a UNC path, it does not work. It
says it cannot find the specified path. Below is the code I am using

Dim dirInfo as New DirectoryInfo("\\ServerName\Directory\SubDirectory ")

I can only get this to work when I use local directories such as "D:\"

Any help is appreciated.
Thanks
Aug 31 '05 #1
1 1351
Hmm, is there any permissioning problems... I just used this
DirectoryInfo di = new DirectoryInfo(@\\server2\software); and it worked
fine.

The documentation specifically states yoiu can use UNC
http://msdn.microsoft.com/library/de...classtopic.asp
so there may b e some other problem...like full read/write access

"Andy" <An**@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
I am trying to use the DirectoryInfo class to create links on a web page to
files in the specified directory. I can get it to work just fine. The
problem I am having is when I try to put in a UNC path, it does not work.
It
says it cannot find the specified path. Below is the code I am using

Dim dirInfo as New DirectoryInfo("\\ServerName\Directory\SubDirectory ")

I can only get this to work when I use local directories such as "D:\"

Any help is appreciated.
Thanks

Aug 31 '05 #2

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

Similar topics

7
by: Charts | last post by:
I login as administrator of the machine. However running the following code get access denied exception for file inside the directory. The source code: DirectoryInfo target = new...
0
by: I am Sam | last post by:
I keep getting an error that my listbox control is incompatible with the source as follows: The base class includes the field 'IMGList', but its type (System.IO.DirectoryInfo) is not compatible...
3
by: xenophon | last post by:
This following innocuous code: System.IO.DirectoryInfo fff = new System.IO.DirectoryInfo(); System.IO.FileInfo ppp = fff.GetFiles( Request.MapPath(".") ); for( int ccc=0 ; ccc < ppp.Length ;...
13
by: Tom Scales | last post by:
OK, I admit, I am not a VB.NET expert and am still learning, but have run into an annoying problem. I'm writing a program that has to search the file system and therefore processes large numbers...
1
by: Andy | last post by:
I am trying to use the DirectoryInfo class to create links on a web page to files in the specified directory. I can get it to work just fine. The problem I am having is when I try to put in a UNC...
2
by: rn5a | last post by:
Suppose I have the following code: <script runat="server"> Sub Page_Load(.....) Dim dInfo As DirectoryInfo Dim fsi As FileSystemInfo dInfo = New DirectoryInfo(Server.MapPath("Folder1")) ...
2
by: rn5a | last post by:
Using the FileSystemInfo class, I am retrieving all the directories & files existing in a particular directory on the server & listing them in a ListBox. If an item in the ListBox happens to be a...
8
by: JonnyBlaze | last post by:
Hi Guys - This is my first C# app, but I have some knowledge of a bunch of languages like VB6 and PHP, so I'm picking it up rather quickly. I've been pulling my hair out on this one for about 4...
0
by: nagashree | last post by:
Hi, i want to compress the file or directory i am able to do that can anybody help me to decompress the file when i double click on the zipped file i am getting the error message as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.