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

Discussion in 'ASP .Net' started by Christian from France, Aug 12, 2008.

  1. 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
    Christian from France, Aug 12, 2008
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    >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
    Juan T. Llibre, Aug 12, 2008
    #2
    1. Advertising

  3. Re: How to access a network share and read directory info in aspne

    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" <> wrote in message
    > news:...
    > >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

    >
    >
    >
    Christian from France, Aug 13, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CES
    Replies:
    1
    Views:
    534
  2. Steve Roszko

    Access Network Share with ASP.NET

    Steve Roszko, Oct 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    778
    Steve Roszko
    Oct 22, 2003
  3. Walter Wang [MSFT]
    Replies:
    3
    Views:
    1,152
    Walter Wang [MSFT]
    Jan 12, 2007
  4. CES
    Replies:
    1
    Views:
    217
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,287
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page