private void frmRemotingServer_Load(object sender, EventArgs e) { frmPortSet fc = new frmPortSet(); fc.ShowDialog(); TimeSpan ff = new TimeSpan(0); RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; RemotingConfiguration.CustomErrorsEnabled(false); System.Runtime.Remoting.Lifetime.LifetimeServices.LeaseTime = ff; BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider(); provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; IDictionary props = new Hashtable(); props["port"] = Port; TcpChannel chan = new TcpChannel(props, null, provider); ChannelServices.RegisterChannel(chan, false); Operater = new Oral(); ObjRef obj = RemotingServices.Marshal(Operater, "Tcpservice"); RemotingServices.Unmarshal(obj); notifyIcon1.Text = "端口号:" + Port.ToString() + "remoting服务正在运行中"; this.Visible = false; //DataSet dsdoc = Operater.GetDataSet("select * from t_patient_doc_colb where tid=7017004"); //string Xmldoc = dsdoc.Tables[0].Rows[0]["CONTENT"].ToString(); //byte[] imgs = Operater.GetDocImage(Xmldoc); //Image tt = imgs[0]; }
private void frmRemotingServer_Load(object sender, EventArgs e) { TimeSpan ff = new TimeSpan(0); RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; RemotingConfiguration.CustomErrorsEnabled(false); System.Runtime.Remoting.Lifetime.LifetimeServices.LeaseTime = ff; BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider(); provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; IDictionary props = new Hashtable(); props["port"] = Port; TcpChannel chan = new TcpChannel(props, null, provider); ChannelServices.RegisterChannel(chan, false); Oral Operater = new Oral(); ObjRef obj = RemotingServices.Marshal(Operater, "Tcpservice"); RemotingServices.Unmarshal(obj); notifyIcon1.Text = "端口号:" + Port.ToString() + "remoting服务正在运行中"; }
private void timer1_Tick(object sender, EventArgs e) { try { //if (today == "") //{ // today = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString(); //} //else if (today != DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString()) //{ // today = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString(); // XmlDocument doc = new XmlDocument(); // doc.Load(Application.StartupPath + @"\Operator\Users.xml"); // doc.SelectSingleNode("Users").RemoveAll(); // doc.Save(Application.StartupPath + @"\Operator\Users.xml"); //} this.Visible = false; Oral.RemoveOutLimited(); richTextBox1.Text = ""; for (int i = 0; i < Oral.ArrCients.Count; i++) { client_obj tb = (client_obj)Oral.ArrCients[i]; tb.LinkCount++; string strval = tb.Ip + " " + tb.UserName + " " + tb.ZhiWu + " " + tb.ZhiCheng + " " + tb.Account_Name; if (richTextBox1.Text.Trim() == "") { richTextBox1.Text = strval; } else { richTextBox1.Text = richTextBox1.Text + "\n" + strval; } } } catch { } }