不知道可不可以用IO来直接读取其他机的文件。
不过可以用其他方法解决,用SOCKET来解决,不过要写一个服务端同客户端。
原理同FTP一样。

解决方案 »

  1.   

    不知道可不可以用IO来直接读取其他机的文件
    访问其他机也需要ip地址或机器名。
    提示错误:http 500-内部服务器错误
      

  2.   

    在c/s下,没有问题
    在b/s下,是否 就象访问服务器路径,要设置成虚拟路径类似,才能访问别的机器
      

  3.   

    既然在C/S没问题,你可以把这功能封装在组件中,
    然后在B/S下进行调用啊。
      

  4.   

    我把该功能放到dll里面,但是还不行。
    与直接调用错误相同。
      

  5.   

    dll内容:
    Namespace aa
        Public Class Class1
            Public Declare Function LanDownLoad Lib "W_kqrec.dll" Alias "_LANDOWNLOAD" (ByVal IpAddr As String) As Integer
            Public Declare Function LanSetTime Lib "W_kqrec.dll" Alias "_LANSETTIME" (ByVal IpAddr As String, ByVal year As Integer, ByVal month As Integer, ByVal day As Integer, ByVal hour As Byte, ByVal minute As Byte, ByVal second As Integer, ByVal week As Integer) As Integer
            Public Declare Function LanManyDownLoad Lib "W_kqrec.dll" Alias "_LANMANYDOWNLOAD" (ByVal IpAddr As String, ByVal filen As Integer) As Integer
            Public Function Test() As String
                Dim testflag As Integer
                
                testflag = LanManyDownLoad("192.8.8.1", 1)
    If testflag = 0 Then
                    str = "success"
                Else
                    str = "fail"
                End If
                Return str
            End Function
        End Class
    End Namespace在asp.net页面调用       Dim str As String
            Dim a As New a.aa.Class1()
            str = a.Test
            Page.RegisterStartupScript("aa", "<script> window.alert(""" & str & """); </script>")
      

  6.   

    is this 一台考勤机 also a web server? If yes, use HttpWebRequest or WebClient class in System.Net namespace. If not, you might need to impersonate a LAN user to access the file directly
      

  7.   

    考勤机只是一台网络设备,类似网络打印机,有rj45口,可以设置ip地址,通过网线直接连接到局域网。 
    应该不是a web server吧!
      

  8.   

    我改了一下用户aspnet的权限,可以下载考勤记录文件,但下载到.net安装目录下.
     最后,我用windows(vb.net)窗体做了下载数据并放到数据库中.
    感谢各位的关注!!