How to access a network share and read directory info in aspnet c#

  • Thread starter Christian from France
  • Start date

Christian from France

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,


Juan T. Llibre

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, MVP faq :
foros de, en español :

Christian from France

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 server but another host in my local network)


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