reading files on network

J

Jazper Manto

hi

i have a webservice which sould read a file on another PC in our network.
the security on the directory "\\Srv1\Tmp" is Everyone FullControl!
however even the System.IO.File.Exists() returns false although the file
exists.
whats wrong??? how can a webservice read a file on another computer in the
same network.???

thanx for every little hint
jazper

--- CODE Webservice ---
[WebMethod]
public void test_read(string filename)
{
if( System.IO.File.Exists(filename) )
{
System.IO.FileStream fs = System.IO.File.Open(filename,
System.IO.FileMode.Open, System.IO.FileAccess.Read);
if( fs.CanRead )
{
int bty = fs.ReadByte();
}
fs.Close();
}
}

--- CODE Windows Application ---
private void button2_Click(object sender, System.EventArgs e)
{
string filename = @"\\Srv1\Tmp\test.txt";
ws35service.Service1 myservice = new ws35service.Service1();
myservice.Credentials = System.Net.CredentialCache.DefaultCredentials;
myservice.test_read(filename);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top