Hprose客户端使用
2021-06-28 · 1 阅读
//引用Hprose
using Hprose.RPC;
//定义服务器那边的接口
public interface Topapi{
public Hprose.Collections.Generic.NullableKeyDictionary<string,string> reg(object data);
}
//调用接口
private void 注册按钮_Click(object sender, EventArgs e)
{
Hprose.RPC.Client c = new Client("http://127.0.0.1/Topapi");
Topapi hello = c.UseService<Topapi>();
var obj = new {username = "123",password = "321" };
Hprose.Collections.Generic.NullableKeyDictionary<string, string> a = hello.reg(obj);
MessageBox.Show(a["msg"]);
}