reading files on network

Discussion in 'ASP .Net Web Services' started by Jazper Manto, Sep 3, 2004.

  1. Jazper Manto

    Jazper Manto Guest

    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);
    }
    Jazper Manto, Sep 3, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kal
    Replies:
    1
    Views:
    9,504
    Kevin Spencer
    Jun 21, 2004
  2. Jane Davis

    Network Service account over network

    Jane Davis, Jun 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    430
    Kevin Spencer
    Jun 22, 2005
  3. Bill Volk
    Replies:
    1
    Views:
    3,135
    Bill Volk
    Jul 2, 2003
  4. Replies:
    8
    Views:
    4,307
    Andrew Thompson
    Oct 12, 2005
  5. kin
    Replies:
    0
    Views:
    911
Loading...

Share This Page