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

Accessing files and folders on remote server in webApplication

Hi

I got this problem for the web application

I try to access folders on a remote server. string[] dirs = Directory.GetDirectories(@"E:\vehicles")
E drive is a map to a network drive. I get the DirectoryNotFoundException. How do I solve the problem or the is another way to write the code

Thank you
Nov 18 '05 #1
2 2169
You need to access the network folder using UNC path. Drive letter is
mapped based on the interactive user (The user that is currently
logged on to the machine). The default of an ASP.NET web application
runs under the "ASPNET" user, which does not have the "E" drive letter
mapped.

For example,

Directory.GetDirectories(@"\\Remote server name\vehicles");

Tommy,

"Z0gS" <an*******@discussions.microsoft.com> wrote in message news:<A4**********************************@microso ft.com>...
Hi,

I got this problem for the web application:

I try to access folders on a remote server. string[] dirs = Directory.GetDirectories(@"E:\vehicles");
E drive is a map to a network drive. I get the DirectoryNotFoundException. How do I solve the problem or the is another way to write the code?

Thank you

Nov 18 '05 #2

What if the remote server need a password and username, what will be the syntax if using the UNC server pat
----- Tommy wrote: ----

You need to access the network folder using UNC path. Drive letter i
mapped based on the interactive user (The user that is currentl
logged on to the machine). The default of an ASP.NET web applicatio
runs under the "ASPNET" user, which does not have the "E" drive lette
mapped

For example,

Directory.GetDirectories(@"\\Remote server name\vehicles")

Tommy

"Z0gS" <an*******@discussions.microsoft.com> wrote in message news:<A4**********************************@microso ft.com>..
Hi
I got this problem for the web application
I try to access folders on a remote server. string[] dirs = Directory.GetDirectories(@"E:\vehicles")

E drive is a map to a network drive. I get the DirectoryNotFoundException. How do I solve the problem or the is another way to write the code
Thank yo


Nov 18 '05 #3

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

Similar topics

9
by: Tommy | last post by:
Hi I've uploaded the .aspx files and Web.config file made in VS.NET 2003 but I get this error http://empty- site.org/Login.aspx . I did change the config file as mentioned but with no luck ....
36
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
1
by: Z0gS | last post by:
I got this problem for the web application I try to access files on a remote server. string dirs = Directory.GetDirectories(@"E:\vehicles") E drive is a map to a network drive. I get the...
1
by: Max Baki via .NET 247 | last post by:
I all, i've write a sample ftp Windows service which download files and copy them on remote share or remote mapped drive (the service works fine on local drives). This part of code is the...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
0
by: John Fleming | last post by:
Hello, I am building a web application with the following components: 2 Web Servers - Windows Server 2003 - IIS 6 - .Net Framework version 2.0 - Reside in Domain A 2 Clustered Database...
0
by: phil.stollery | last post by:
Hi, I've currently setup a local user as described in: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT01.asp This users has been created on the remote...
1
by: Thom Little | last post by:
I have a simple web service that requires no input and returns a character string. I created the service and FTPd it to a remote server. The .dll to the .bin directory and the single .asmx file...
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.