}}伺服器端:是乙個控制台,首先要新增對system.runtime.remoting的引用,然後新增對remotingmodel的引用
using
system;
using
system.collections.generic;
using
system.text;
using
system.runtime.remoting;
using
system.runtime.remoting.channels;
using
system.runtime.remoting.channels.tcp;
using
remotingmodel;
namespace
remotingserver
}}客服端:窗體:兩個textbox,乙個button,設定textbox為多行。上面的textbox為:txtcontent,下面的為:txtword
新增引用(新增方法同上)using
system.runtime.remoting;
using
system.runtime.remoting.channels;
using
system.runtime.remoting.channels.tcp;
using
remotingmodel;
namespace
remotingclient
private
void btnsend_click(object
sender, eventargs e)
catch
(exception ex)
}private
void form1_load(object
sender, eventargs e)
catch
(exception ex)}}
}好了,下面看看結果:
注:以上所有操作均在同一臺電腦,並且在同乙個解決方案執行。
接下來會跟大家分享remoting在區域網裡的使用
AppWidget簡單實現
override public void onreceive context context,intent intent override todo auto generated method stub system.out.println onupdate override todo auto g...
簡單BinaryTree實現
package binarytree 選擇第乙個元素作為根節點 比根節點打的資料儲存在右子數 比根節點資料小的儲存在左子樹 輸出 中序遍歷 左 中 右 author ly public class testbinarytree package binarytree 二叉樹實現類 public cla...
Spring AOP簡單實現
下面用乙個簡單示例演示aop的使用,在執行目標方法前執行日誌輸出。這也是aop最重要的作用,分離與業務無關的 建立target類,是被 的物件,有乙個execute方法。package com.home.web.manager public class target 建立通知類,可以攔截目標物件的e...