473,320 Members | 1,707 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.

error: the network path not found

38
Hi ,
I want to upload some files to a remote machine frequently.We have an ftp .But I cannot use FTP for uploading file as ftp is not available from remote server. I planned to write an application for that using FileWebResponse class. As a starting point I just tried to access that machine using program. But I am getting an error like the network path not found.

Expand|Select|Wrap|Line Numbers
  1.  FileWebResponse response=null;   
  2.             try   
  3.             {   
  4.                 Uri uri = new Uri("file://remotemachinename/sharedfolder/sample.txt");   
  5.  
  6.                if (uri.Scheme == Uri.UriSchemeFile)   
  7.               {   
  8.                     FileWebRequest request = (FileWebRequest)FileWebRequest.Create(uri);   
  9.                     request.Credentials = new NetworkCredential  ("username", "password", "domainname");   
  10.                     response = (FileWebResponse )request.GetResponse();  //ERROR happens here 
  11.                     StreamReader reader = new StreamReader(response.GetResponseStream());   
  12.                     string tmp = reader.ReadToEnd();   
  13.                     response.Close();   
  14.                }   
  15.             }   
  16.             catch(Exception ex)   
  17.             {   
  18.                 Console.WriteLine(ex.Message);   
  19.  
  20.                             }   
  21.             finally   
  22.             {   
  23.                 if (response != null)   
  24.                 {   
  25.                     response.Close();   
  26.                 }   
  27.  
  28.             }   


Note: Remotemachine is not in my network. I am able to connect the remotemachine using mstsc with a username and password in the domain of remotemachine. I want to read a file in a shared folder in D drive of that machine.
Could anybody give me a hint ...?

Thanks in advance,
jaleel
Jul 2 '08 #1
3 2454
Plater
7,872 Expert 4TB
FileWebResponse appears to be the equiv of using file://, which I don't think has "write" ability, only "read" ?
Jul 2 '08 #2
jaleel
38
Thanks Plater.

I could not connect to machine at all.In the above post contains code only for reading . Even that is not working. I think some problem with URI I created to connect the remote machine. Is it not possibile to connect machine in some other domain if I have a user account in that domain...?

Thanks in advance,
akjal
Jul 3 '08 #3
Plater
7,872 Expert 4TB
If you can type that URI into your browser and have it work correctly it *should* work in your code. You even put in the network credential, so I don't know what is wrong there.
Jul 3 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Matt | last post by:
I am migrating from NT 4.0 (IIS 4) to 2003 Server (IIS 6). Our Intranet has numerous applications that utilize the FileSystemObject (FSO) and each one is returning a "Path not found." error. These...
11
by: Vijay Chegu | last post by:
I have built a 64bit ATL COM dll. When i register the dll on IA64 windows Enterprise server 2003, i get following error. DllRegisterServer in mydll.dll failed. Return code was : 0x80020009 ...
1
by: Keith | last post by:
All, I have been told this is an ASP.NET issue and not an IIS issue, so I am posting this here. I have a problem with ASP.NET returning an HTTP 500 error when trying to run ASPX pages on...
5
by: Paul Smith | last post by:
I am hoping this is a simple problem for someone. We have two development servers, DEVNET (a web server) and DEVSQL (a DB / File Server). We have recently moved all of our .NET source code from...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
0
by: xz | last post by:
I just installed Visual web dev. 2005 beta 1. I've never used the lite SQL server 2005 database, so I decided to try it out. From the Visual web dev. I selected 'create new sql server database' ...
4
by: alex444 | last post by:
Any help on this error much appreciated. Application works on dev but not on 3d party host server (with useless support). ========================== Server Error in '/' Application....
3
by: Olav | last post by:
I get this error in the EventLog when I try to open an ASP.NET 2.0 web page. What should I look for to fix the problem? Olav Event code: 3006 Event message: A parser error has occurred....
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.