注册你的数据库访问类到服务器上
客户端可以远程访问到该类
然后就可以直接操作服务器了
采用tcp/ip协议

解决方案 »

  1.   

    我做过一个可以截取客户端屏幕的程序,不知道你的监控是不是要REAL TIME。
      

  2.   

    to  Brunhild() :
    是的!可以给我参考下吗?
      

  3.   

    使用 tcp 通道进行远程处理编写简单的“hello world”远程应用程序。客户端将一个字符串传递到远程对象上,该远程对象将单词“hi there”附加到字符串上,并将结果返回到客户端。将此文件保存为 server.cs。此处为服务器的代码:using system;
    using system.runtime.remoting;
    using system.runtime.remoting.channels.tcp;namespace remotingsamples {
      public class helloserver : ihello {    public static int main(string [] args) {      tcpchannel chan = new tcpchannel(8085);
          channelservices.registerchannel(chan);
          remotingservices.registerwellknowntype(
            "server", "remotingsamples.helloserver", "sayhello", wellknownobjectmode.singlecall);
          system.console.writeline("请按  键退出...");
          system.console.readline();
          return 0;
        }    public helloserver()
        {
          console.writeline("helloserver 已激活");
        }    ~helloserver()
        {
          console.writeline("对象已清除");
        }    public forwardme hellomethod(forwardme obj)
        {
          console.writeline("hello.hellomethod : {0}", name);
          return "hi there "   name;
        }
      }
    }
      

  4.   

    将此代码保存为 client.cs:using system;
    using system.runtime.remoting;
    using system.runtime.remoting.channels.tcp;namespace remotingsamples {
      public class client
      {
        public static int main(string [] args)
        {
          tcpchannel chan = new tcpchannel();
          channelservices.registerchannel(chan);
          forwardme param = new forwardme();
          helloserver obj = (helloserver)activator.getobject(
            typeof(remotingsamples.helloserver), "tcp://localhost:8085/sayhello");
          if (obj == null) system.console.writeline("无法定位服务器");
          else {
            console.writeline("值为 "   param.getvalue());
            forwardme after = obj.hellomethod(param);
            console.writeline("呼叫后的值为 "   after.getvalue());
          }
          return 0;
        }
      }
    }
    下面是 makefile:all: server.exe client.exe share.dllshare.dll: share.cs
       csc /debug  /target:library /out:share.dll share.csserver.exe: server.cs
       csc /debug  /r:share.dll /r:system.runtime.remoting.dll server.csclient.exe: client.cs server.exe
       csc /debug  /r:share.dll /r:server.exe /r:system.runtime.remoting.dll client.csclean:
       @del server.exe client.exe *.pdb *~ *.*~
      

  5.   

    redbb(. Dotneter .):
    你的代码不全吧?还有share.cs呢?