public void Update(string IP) { GetPostString.RequestString requestString = new GetPostString.RequestString(); requestString.InitializeDict(AccessKeyId); requestString.DictData.Add("Action", "UpdateDomainRecord"); requestString.DictData.Add("RecordId", RecordId); requestString.DictData.Add("RR", HostRecord); requestString.DictData.Add("Type", "A"); requestString.DictData.Add("Value", IP); requestString.DictData.Add("TTL", TTL); requestString.Signature(AccessKeySecret); string HttpGetString = requestString.Serialization(); string Return = CreateGetHttpResponse("http://alidns.aliyuncs.com/?" + HttpGetString); }
public string Select() { GetPostString.RequestString requestString = new GetPostString.RequestString(); requestString.InitializeDict(AccessKeyId); requestString.DictData.Add("Action", "DescribeDomainRecords"); requestString.DictData.Add("DomainName", DomainName); requestString.Signature(AccessKeySecret); string HttpGetString = requestString.Serialization(); string R = CreateGetHttpResponse("http://alidns.aliyuncs.com/?" + HttpGetString); JObject obj = JObject.Parse(R); string IP = ""; try { IP = obj.SelectToken("$.DomainRecords.Record[?(@.RR == '" + HostRecord + "')].Value").Value <string>(); } catch { IP = null; goto cc; } RecordId = obj.SelectToken("$.DomainRecords.Record[?(@.RR == '" + HostRecord + "')].RecordId").Value <string>(); cc : return(IP); }