c# - How searching files on the client-side from a webservice placed on the server? -


i have webservice. webservice calling server side. , when service looking c-drive, he's looking in server area. when expected c-drive on client-side.

 if (!file.exists(filename)) // filename = "c:\\temp\myfile.pdf"; must on client-side. looks on server-side.      throw new filenotfoundexception(string.format("file not found: '{0}'!", filename)); 

i want see "c:\temp\myfile.pdf" on client-side , "\\myserver\c$\temp\myfile.pdf" on server-side.

what have do?

try following code,

fileinfo fi = new fileinfo(@"\\myserver\share\myfile.pdf"); bool exists = fi.exists; 

note: have transform file path above format.

updated conversion part,

string filename = path.getfilename(@"c:\share\myfile.pdf"); string clientpath= @"\\myserver\share\"; fileinfo fi = new fileinfo(path.combine(clientpath,filename)); bool exists = fi.exists; 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -