111,126
社区成员
发帖
与我相关
我的任务
分享
public interface productApi
{
//传递一个对象,用Hashtable代替
string setTrade(Hashtable trade);
}
Hashtable trade = new Hashtable();
//Hashtable item = new Hashtable();
ArrayList al = new ArrayList();
// ClassItem是一个类
ClassItem it = new ClassItem();
//设置类的颜色属性或者使用hashtable的方式
it.color = "white";
//item.Add("color", "white");
al.Add(it);
trade.Add("items", al);
CHessianProxyFactory factory = new CHessianProxyFactory();
string url = "http://10.0.1.148/hessian/api/productApi";
productApi test = (productApi)factory.Create(typeof(productApi), url);
//传递一个trade对象,包含一组对象集合al,al
MessageBox.Show(test.setTrade(trade));