Jump to content
  • Advertisement
Sign in to follow this  
akjal

[.net] error: the network path not found

This topic is 3644 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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. FileWebResponse response=null; try { Uri uri = new Uri("file://remotemachinename/sharedfolder/sample.txt"); if (uri.Scheme == Uri.UriSchemeFile) { FileWebRequest request = (FileWebRequest)FileWebRequest.Create(uri); request.Credentials = new NetworkCredential ("username", "password", "domainname"); response = (FileWebResponse )request.GetResponse(); //ERROR happens here StreamReader reader = new StreamReader(response.GetResponseStream()); string tmp = reader.ReadToEnd(); response.Close(); } } catch(Exception ex) { Console.WriteLine(ex.Message); } finally { if (response != null) { response.Close(); } } 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,

Share this post


Link to post
Share on other sites
Advertisement

Hi All,
Is there any other way to achieve the same. I mean, uploading files to a remote machine outside my network. I have a user account with admin privilege in the remote machine. Any help ...plz?

Share this post


Link to post
Share on other sites
Yes it is called ftp. Yes I know ftp is not on the remote machine but if it is going to be receiving files, don't you think it should have ftp. File shares work well on a local network but it is not designed for internet transfers.

theTroll

Share this post


Link to post
Share on other sites
Thank u so much TheTroll for your reply.

files are most of the time dlls and exe.Most of the times they are of size in KBs.

What could be the reason ftp site is not accessibile from a server?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!