C# .NET - upload file to the server c# win form

Asked By fady sayegh on 23-Mar-06 12:08 PM
hi to all,
how can i upload a file from my client(computer) to the server ?
i tried the code below but it gives this error : 
"Remote server returned an error (405) : Method not allowed".
WebClient oWebClient = new WebClient();
oWebClient.UploadFile("http://srvdev/philae_edition/TestCompta.txt", "c:\temp\TestCompta.txt");
oWebClient = null;
any ideas ?
best regards and thanks in advance
fady

File Copy - Asked By F Cali on 23-Mar-06 12:17 PM

To copy a file from your machine to the server, you can use the File.Copy method:
File.Copy("TestCompta.txt", "\\DestinationServer\SharedFolder");

upload file to the server c# win form - Asked By fady sayegh on 23-Mar-06 12:45 PM

thanks for the idea, it works
fady