Ask a Question related to ASP.NET Security, Design and Development.
-
Vasko Peter #1
how to get to file in intranet using WebClient. simple ?!
Hi All,
I am breaking my head on one problem. I'd like to read a file that is on a
different machine in intranet. The tricky part is that I do not want to
allow an access for EVERYONE but want to minimise it for my machine only.
My Idea was to access the test.txt file as a user (MYUSERNAME) with my
password. I can access the file via file browser but if I do it in ASP.NET
Web application I get an access denied error.
The code is:
WebClient webClient = new WebClient();
string username = "MYMACHINENAME\\MYUSERNAME";
string password = "MYPASSWORD";
string domain = "MYDOMAIN";
webClient.Credentials = new
System.Net.NetworkCredential(username,password,dom ain);
binFile = webClient.DownloadData("\\\\FRIENDSCOMPUTER\\Test\ \test.txt");
if (binFile.Length == 0) return null;
MemoryStream memStream = new MemoryStream(binFile);
I would be really thankful if you could point me to a solution.
Thanks a lot
p.
Vasko Peter Guest
-
Link to live file on intranet drive?
Typically when using the Contribute "Link to a File on my Computer" contribute will grab a "snapshot" of that file and post it to the website. The... -
Webclient w/ Proxy
I have a WebClient.OpenRead that is timing out on some client machines. I believe the problem may be Proxy settings on the client machine. How... -
webclient.downloadfile
I've been toying with an asp.net diretory browser and have been trying to use system.net.webclient.downloadfile as a means to download files from... -
DefaultCredentials and WebClient
I'm trying to make a call inside an ASP.NET web application to an external quasi-web service (aka FrontPage Server Extensions): Dim rpcClient As... -
webclient object and downloading output file from an intranet site
Dear ASP.NET Programmers, I have an intranet site (web applicaton) with the login page http://burak/database/login.aspx. The site implements...



Reply With Quote

