473,320 Members | 1,953 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 a network share and read directory info in aspnet c#

I want to write an aspnet aspx page

This page :
1 - Connect to a net share
\\server\c$ with credentials: user/password

2 - Read Directory info of this share

3 - Write these infos in the page

Is anobody as a sample to do that ?

Thanks a lot,

Christian
Aug 12 '08 #1
3 8154
The System.IO class has everything you need.

You will, however, need to impersonate the account ASP.NET is running as,
as a network account which has permission to access the network share.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Christian from France" <Ch*****************@discussions.microsoft.comwrot e in message
news:10**********************************@microsof t.com...
>I want to write an aspnet aspx page

This page :
1 - Connect to a net share
\\server\c$ with credentials: user/password

2 - Read Directory info of this share

3 - Write these infos in the page

Is anobody as a sample to do that ?

Thanks a lot,

Christian

Aug 12 '08 #2
I found api to access to a local directory information but not to access to a
remote network share providing credentials (user/password).
How can i connect to a net share \\fileserver\c$ with credentials
(user/password) ?
(fileserver is not my asp.net server but another host in my local network)

Christian

"Juan T. Llibre" wrote:
The System.IO class has everything you need.

You will, however, need to impersonate the account ASP.NET is running as,
as a network account which has permission to access the network share.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Christian from France" <Ch*****************@discussions.microsoft.comwrot e in message
news:10**********************************@microsof t.com...
I want to write an aspnet aspx page

This page :
1 - Connect to a net share
\\server\c$ with credentials: user/password

2 - Read Directory info of this share

3 - Write these infos in the page

Is anobody as a sample to do that ?

Thanks a lot,

Christian


Aug 13 '08 #3
"Christian from France" <Ch*****************@discussions.microsoft.com>
wrote in message news:77**********************************@microsof t.com...
>>I want to write an aspnet aspx page

This page :
1 - Connect to a net share
\\server\c$ with credentials: user/password

The System.IO class has everything you need.

You will, however, need to impersonate the account ASP.NET is running as,
as a network account which has permission to access the network share.

I found api to access to a local directory information but not to access
to a
remote network share providing credentials (user/password).
How can i connect to a net share \\fileserver\c$ with credentials
(user/password) ?
(fileserver is not my asp.net server but another host in my local network)
http://www.west-wind.com/WebLog/posts/1572.aspx
http://www.google.co.uk/search?sourc...+impersonation
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 13 '08 #4

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

Similar topics

6
by: moonriver | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
0
by: Steve Roszko | last post by:
Accessing Network Share with ASP.NET FILESERVER1 (file server) E:\WWWexport\ Shared as WWWExport WEBSERVER2 (webserver) I created virtual directory to \\FILESERVER1\WWWExport\
5
by: Dave Kolb | last post by:
Is there any other solution for an ASPNET application to access network resources other than running as SYSTEM, using delegation (a nightmare to get to work) or the COM+ solution? I cannot seem to...
4
by: Scott Nicholson | last post by:
I've got a site set up that uses a network share as it's home directory. Simple stuff is working fine. When I try to put a database in there, though, I run into problems. I'm using: dim...
10
by: Shawn | last post by:
JIT Debugging failed with the following error: Access is denied. JIT Debugging was initiated by the following account 'PLISKEN\ASPNET' I get this messag in a dialog window when I try to open an...
16
by: JonnyD | last post by:
I am working on a project to build a reporting web app from an exsiting database that is controled by a local application. The application that has control over the database creates a lock file to...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
3
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.