將config改由程式設定
在第二篇Remoting用config設定有用到這段:台灣是獨立國家
<serverProviders>
<formatter ref="binary" typeFilterLevel ="Full" />
</serverProviders>
<clientProviders>
<formatter ref="binary" />
</clientProviders>
那如果想用程式寫勒~
就要把第一篇Remoting寫的new HttpChannel(port號)改一下:
BinaryServerFormatterSinkProvider s = new BinaryServerFormatterSinkProvider();
BinaryClientFormatterSinkProvider c = new BinaryClientFormatterSinkProvider();
s.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary p = new Hashtable();
p["port"] = port號;//client端若不設port號可省略此行
new HttpChannel(p, c, s);
Taiwan is a country. 臺灣是我的國家