473,545 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8168
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************ *****@discussio ns.microsoft.co mwrote in message
news:10******** *************** ***********@mic rosoft.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************ *****@discussio ns.microsoft.co mwrote in message
news:10******** *************** ***********@mic rosoft.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************ *****@discussio ns.microsoft.co m>
wrote in message news:77******** *************** ***********@mic rosoft.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
9681
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 10:24:48 AM run() error: System.IO.IOException: The specified network password is not correct. at System.IO.__Error.WinIOError(Int32 errorCode,...
3
24003
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 tables in the database where the code resides. If we move the database with the data tables to a new directory, the links are no longer valid. I...
0
1523
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
3097
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 impersonate a user and obtain network credentials using the DuplicateTokenEx call with appropriate parameters even though the call seems to not...
4
5898
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 dbconn,sql,dbcomm dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("test.mdb") & ";")
10
8687
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 asp.net page. If I press OK then I get a page with this message: Server Application Unavailable The web application you are attempting to access...
16
1968
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 the database and at that point I can no longer access the database with my web app. Is there anyway around this? All I need is read only access to...
3
7945
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 C:\Inetpub\wwwroot\RunReportASP is the directory of my virtual directory for my app. In it's properties I did check "Write" as a permission. What else...
3
5042
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 the network share. It loads in VS2005 fine, and I can edit and save code changes etc, but when I try and Build the solution, I get the following...
0
7487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7420
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3476
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.