myremotableobject.cs
来自「航班查询系统,可以连接实现443与350端口的应用,是不可多得的范例」· CS 代码 · 共 59 行
CS
59 行
using System;
using System.Windows.Forms;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Threading;
namespace RemotableObjects
{
public class MyRemotableObject : MarshalByRefObject
{
ManualResetEvent alldone = new ManualResetEvent(false);
private string resultstring = "";
public MyRemotableObject()
{
}
public string ResultString
{
set
{
resultstring = value;
}
}
public void Set()
{
alldone.Set();
}
public string SetMessage(string message)
{
lock (this)
{
alldone.Reset();
Cache.GetInstance().MessageString(this,message);
alldone.WaitOne();
}
System.Threading.Thread.Sleep(200);
return resultstring;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?