public Ret OpenCard(string factory, string kmm, string kh, string dqdm)
{
String args = "OpenCard";
Log.Debug(args + " started.");
args += " " + (String.IsNullOrWhiteSpace(factory) ? "0" : factory);
args += " " + (String.IsNullOrWhiteSpace(kmm) ? "\"0\"" : "\"" + kmm + "\"");
args += " " + (String.IsNullOrWhiteSpace(kh) ? "0" : kh);
args += " " + (String.IsNullOrWhiteSpace(dqdm) ? "0" : dqdm);
String result = null;
WriteRet ret = new WriteRet();
try
{
if (this.Spawn(args, out result))
{
ret = JsonConvert.DeserializeObject<WriteRet>(result);
Log.Debug(args + "=" + result);
}
else
{
ret.Err = "调用未返回。";
Log.Debug(args + "=" + ret.Err);
}
}
catch (Exception e)
{
ret.Exception = e.Message;
ret.Err = "调用错误。";
}
return ret;
}
}