| 
					
				 | 
			
			
				@@ -61,6 +61,11 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //扫描回车触发事件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public event SNKeyDown SNKeyDownEven; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //自动key提取委托 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public delegate void AutoKeyRequireDelegate(IntPtr intPtr, string key, string keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //自动key提取事件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public event AutoKeyRequireDelegate AutoKeyRequire; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //定义一个委托  调用Verify窗口; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         delegate void ShowVerifyCallback(string strMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -864,7 +869,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         keyInfo.Hashkey.data = jObject["hash"].Value<string>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         keyInfo.YouTube_KEY.data = jObject["youtubekey"].Value<string>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         keyInfo.ACASKey_Data.data = jObject["acaskey_data"].Value<string>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //keyInfo.ACASKey_Tool.data = jObject["acaskey_tool"].Value<string>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.ACASKey_Tool.data = jObject["acaskey_tool"].Value<string>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         keyInfo.DAK.data = jObject["dak"].Value<string>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         keyInfo.FVP.data = jObject["FVP"].Value<string>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1592,7 +1597,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 reportdata += "cikey=" + keyInfo.CI_plus.data + "&"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (WriteAttestation.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                reportdata += "attestationmd5=" + keyInfo.Attestation.md5+ "&"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                reportdata += "attestationmd5=" + keyInfo.AttestationMD5.data + "&"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (WriteMGK.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 reportdata += "mgk=" + keyInfo.MGK.data + "&"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1618,8 +1623,8 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (WriteEDIDName.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 reportdata += "EDIDModeName=" + keyInfo.EDIDModelName.data + "&"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //if (WriteACASKey.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //    reportdata += "acas_tool=" + keyInfo.ACASKey_Tool.data + "&"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (WriteACASKey.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                reportdata += "acas_tool=" + keyInfo.ACASKey_Tool.data + "&"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (WriteACASKey.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 reportdata += "acas_data=" + keyInfo.ACASKey_Data.data + "&"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1692,8 +1697,6 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             string error = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 报错信息; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             string ErrMsg = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            string psn = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            string devicecode = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //进工厂 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!TVPort.IsOpen) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2153,67 +2156,275 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 计算获取全部key耗时; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Stopwatch watch = new Stopwatch(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 watch.Start(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                // 只用一个接口获取所有Key;              
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if ( midListNow.keytype.ContainsKey("DSN") ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteDID.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    // 读取dvicecode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (SerialCMD.GetFireTVDevcieCode(TVPort, out result, out data, out error, SerailDelay)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "DeviceID", SN, "devicetype=tcl_unknown_model", errorDBNow, out string did, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        devicecode = Encoding.ASCII.GetString(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if (devicecode == "N/A") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.DID.data = did; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nDeviceID=" + keyInfo.DID); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetDIDError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteMac.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "MAC", SN, midListNow.keytype["MAC"], errorDBNow, out string mac, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.Mac.data = mac; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nMac=" + keyInfo.Mac); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetMacError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteHDCP.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "HDCP_KEY", SN, midListNow.keytype["HDCP_KEY"], errorDBNow, out string hdcp, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.HDCP.data = hdcp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nHDCP=" + keyInfo.HDCP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetHDCPError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteHDCP22.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "HDCP2.2_KEY", SN, midListNow.keytype["HDCP2.2_KEY"], errorDBNow, out string hdcp22, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.HDCP22.data = hdcp22; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nHDCP22=" + keyInfo.HDCP22); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetHDCP22Error, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteESN.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "NETFILX_ESN", SN, midListNow.keytype["NETFILX_ESN"], errorDBNow, out string esn, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.ESN.data = esn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nESN=" + keyInfo.ESN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetESNError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteWiDi.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "WiDi", SN, midListNow.keytype["WiDi"], errorDBNow, out string widi, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.WiDi.data = widi; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nWiDi=" + keyInfo.WiDi); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetWiDiError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteCiplus.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "CI_PLUS_KEY", SN, midListNow.keytype["CI_PLUS_KEY"], errorDBNow, out string ci, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.CI_plus.data = ci; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nCI_plus=" + keyInfo.CI_plus); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetCiError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteWidevine.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetWidevineAnAttestationKey( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        midListNow.host, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        SN, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        midListNow.keytype["Widevine_KEY"], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        errorDBNow, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        out bool isAndroidTV, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        out string widevine, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        out string attestation, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        out error, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        orderNow, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.Widevine.data = widevine; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nWidevine=" + keyInfo.Widevine); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (isAndroidTV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            ErrMsg = string.Format("Device code format error!\r\n{0}", devicecode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            keyInfo.Attestation.data = attestation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            keyInfo.AttestationMD5.data = md5; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nAttestationMD5=" + keyInfo.AttestationMD5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        ErrMsg = string.Format("{0}     Get Device Code Error", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetWidevineError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    // 读取psn的值; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (SerialCMD.ReadFireTVPSN(TVPort, out result, out data, out error, SerailDelay)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteMGK.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "MGK_KEY", SN, midListNow.keytype["MGK_KEY"], errorDBNow, out string mgk, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        psn = keyInfo._PSN.data = Encoding.ASCII.GetString(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.MGK.data = mgk; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nMGK=" + keyInfo.MGK); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        ErrMsg = string.Format("Failed to read PSN when requesting DSN !\r\n{0}", devicecode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetMGKError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                // 部分订单无key,只有Roku信息; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (midListNow.keytype.Count() != 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteFairplay.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (!CommonMethod.GetIDMKeys(midListNow.host, SN, orderNow, psn, devicecode, errorDBNow, out keyInfo, out error)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "Fairplay_KEY", SN, midListNow.keytype["Fairplay_KEY"], errorDBNow, out string fairplay, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.Fairplay.data = fairplay; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nFairplay=" + keyInfo.Fairplay); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        ErrMsg = string.Format("{0} GetIDMKeys Failed!\r\n{1}", SN, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetFairplayError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteWifiMac.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    Log.WriteInfoLog("mid type is null, don't query idm keys"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "MAC", "WiFi_MAC" + SN, midListNow.keytype["MAC"], errorDBNow, out string mac, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.WiFi_MAC.data = mac; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nWiFi_MAC=" + keyInfo.WiFi_MAC); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetMacError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (midListNow.keytype.ContainsKey("DSN")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteBTMac.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    // 预防切了pid后,deviceCode变化了; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (keyInfo.DSN.data.IndexOf(devicecode) == -1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "MAC", "BT_MAC" + SN, midListNow.keytype["MAC"], errorDBNow, out string mac, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        ErrMsg = string.Format("The device code [{0}] is not included in the DSN [{1}]!\r\n", devicecode, keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.BT_MAC.data = mac; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nBT_MAC=" + keyInfo.BT_MAC); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetMacError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteECP.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "ECP_KEY", SN, midListNow.keytype["ECP_KEY"], errorDBNow, out string ecp, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.ECP.data = ecp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nECP_KEY=" + keyInfo.ECP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetECPError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteLEK.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "LEK", SN, midListNow.keytype["LEK"], errorDBNow, out string lek, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.LEK.data = lek; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nLEK=" + keyInfo.LEK); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetLEKError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WritePEK.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "PEK", SN, midListNow.keytype["PEK"], errorDBNow, out string pek, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.PEK.data = pek; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nPEK=" + keyInfo.PEK); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetPEKError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WritePlayready.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "PlayReady_key", SN, midListNow.keytype["PlayReady_key"], errorDBNow, out string playready, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.Playready.data = playready; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nPlayReady_key=" + keyInfo.Playready); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetPlayreadyError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteHash.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "Hashkey", SN, midListNow.keytype["Hashkey"], errorDBNow, out string hash, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.Hashkey.data = hash; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nHashkey=" + keyInfo.Hashkey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetHashkeyError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteYouTube.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "YouTube_KEY", SN, midListNow.keytype["YouTube_KEY"], errorDBNow, out string youtube, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.YouTube_KEY.data = youtube; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nYouTube_KEY=" + keyInfo.YouTube_KEY); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetYouTubekeyError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                #region EDID屏抄写是从MID中获取值; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (WriteEDIDPID.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     keyInfo.EDIDPid.data = midListNow.keytype["edid_pid"]; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2222,7 +2433,40 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     keyInfo.EDIDModelName.data = midListNow.keytype["edid_model_name"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                #endregion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteACASKey.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetAcasKey(midListNow.host, "ACAS_KEY", SN, midListNow.keytype["ACAS_KEY"], errorDBNow, orderNow, out string acaskey_data, out string acaskey_datamd5, out string acaskey_tool, out string acaskey_toolmd5, out error)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.ACASKey_Data.data = acaskey_data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.ACASKey_DataMd5.data = acaskey_datamd5; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.ACASKey_Tool.data = acaskey_tool; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.ACASKey_ToolMd5.data = acaskey_toolmd5; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nACAS_KEY_DATA=" + keyInfo.ACASKey_Data.data + "\r\nACAS_KEY_MD5=" + keyInfo.ACASKey_DataMd5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nACAS_KEY_TOOL=" + keyInfo.ACASKey_Tool.data + "\r\nACAS_KEY_TOOLMD5=" + keyInfo.ACASKey_ToolMd5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetACASKeyError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (WriteDAK.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (CommonMethod.GetKeys(midListNow.host, "DAK", SN, midListNow.keytype["DAK"], errorDBNow, out string hash, out error, orderNow, out string md5)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        keyInfo.DAK.data = hash; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteGetKeyLog("\r\nDAK=" + keyInfo.DAK); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = String.Format("{0}\r\n{1}", LResource.GetDAKKeyError, error); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 watch.Stop(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Log.WriteInfoLog(string.Format("Get All Keys Elapsed={0}", watch.Elapsed.TotalMilliseconds)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3083,6 +3327,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     ErrMsg = string.Format("Widevine format error!\r\n{0}", keyInfo.Widevine.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //MessageBox.Show(LResource.WidevineFormatError + "\r\n" + keyInfo.Widevine); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 byte[] WidevineData = SerialInit.HexToByte(keyInfo.Widevine.data); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3258,6 +3503,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                         goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         else 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4527,60 +4773,126 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 {// 如果是G客户,要在抄写其他key前时行fsn+psn查重处理; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (!CommonMethod.IsNumberAndWord(keyInfo.DSN.data)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // 计算函数耗时; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Stopwatch watch = new Stopwatch(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    watch.Start(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (SN == null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        ErrMsg = string.Format("DSN format error!\r\n{0}", keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        MessageBox.Show("Please scan to trigger testing"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    byte[] DSNData = System.Text.Encoding.ASCII.GetBytes(keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    Log.WriteInfoLog("Write DSN..."); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (SerialCMD.SetFireTVDSN(TVPort, DSNData, out result, out data, out error, SerailDelay)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (SN.Trim().Length == 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        SetsuccessStatus(m_writeDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        Log.WriteInfoLog("Check DSN..."); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if (cfg_writecheck.DSNCheckcheck ? SerialCMD.CheckFireTVDSN(TVPort, out result, out data, out error, SerailDelay) : true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        MessageBox.Show("Please scan to trigger testing"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Log.WriteInfoLog("Read FireTV Device Code...\r\n"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (SerialCMD.GetFireTVDevcieCode(TVPort, out result, out data, out error, SerailDelay)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        string devicecode = Encoding.ASCII.GetString(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (devicecode == "N/A") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            SetsuccessStatus(m_checkDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Log.WriteInfoLog("Read DSN..."); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            if (cfg_readcheck.DSNReadcheck ? SerialCMD.GetFireTVDSN(TVPort, out result, out data, out error, SerailDelay) : true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ErrMsg = string.Format("Device code format error!\r\n{0}", devicecode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 先读取psn的值; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        byte[] result_psn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        byte[] data_psn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        string error_psn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (SerialCMD.ReadFireTVPSN(TVPort, out result_psn, out data_psn, out error_psn, SerailDelay)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            string psn = keyInfo._PSN.data = Encoding.ASCII.GetString(data_psn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (CommonMethod.GetFireTVDsn(midListNow.host, orderNow, Encoding.ASCII.GetString(data), SN, psn, out string dsn, out error_psn, errorDBNow)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                if (SerialInit.BytesCompare_Base64(data, DSNData)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                // 预防切了pid后,deviceCode变化了; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if ( dsn.IndexOf(devicecode) == -1 ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                    SetsuccessStatus(m_readDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                    //DSN读取别对成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    ErrMsg = string.Format("The device code [{0}] is not included in the DSN [{1}]!\r\n", devicecode, dsn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                keyInfo.DSN.data = dsn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (!CommonMethod.IsNumberAndWord(keyInfo.DSN.data)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                    SetfailStatus(m_readDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                    ErrMsg = string.Format("{0}  contrast DSN fail!", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    ErrMsg = string.Format("DSN format error!\r\n{0}", keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                SetfailStatus(m_readDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                ErrMsg = string.Format("{0}  read DSN fail!", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            SetfailStatus(m_checkDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            ErrMsg = string.Format("{0}  check DSN fail!", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        SetfailStatus(m_writeDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        ErrMsg = string.Format("{0}  Write DSN fail!", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                byte[] DSNData = System.Text.Encoding.ASCII.GetBytes(keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                Log.WriteInfoLog("Write DSN..."); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (SerialCMD.SetFireTVDSN(TVPort, DSNData, out result, out data, out error, SerailDelay)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetsuccessStatus(m_writeDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    Log.WriteInfoLog("Check DSN..."); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (cfg_writecheck.DSNCheckcheck ? SerialCMD.CheckFireTVDSN(TVPort, out result, out data, out error, SerailDelay) : true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        SetsuccessStatus(m_checkDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        Log.WriteInfoLog("Read DSN..."); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (cfg_readcheck.DSNReadcheck ? SerialCMD.GetFireTVDSN(TVPort, out result, out data, out error, SerailDelay) : true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            if (SerialInit.BytesCompare_Base64(data, DSNData)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                                SetsuccessStatus(m_readDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                                //DSN读取别对成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                                SetfailStatus(m_readDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                                ErrMsg = string.Format("{0}  contrast DSN fail!", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                                Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                                goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            SetfailStatus(m_readDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            ErrMsg = string.Format("{0}  read DSN fail!", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        SetfailStatus(m_checkDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        ErrMsg = string.Format("{0}  check DSN fail!", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetfailStatus(m_writeDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    ErrMsg = string.Format("{0}  Write DSN fail!", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                ErrMsg = string.Format("错误的PSN {0}", error_psn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ErrMsg = string.Format("Failed to read PSN when requesting DSN !\r\n{0}", devicecode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ErrMsg = string.Format("{0}     Get Device Code Error", SN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    watch.Stop(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Log.WriteInfoLog(string.Format("Write DSN Elapsed={0}", watch.Elapsed.TotalMilliseconds)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 keyInfo.DSN.result = true; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4589,7 +4901,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             #region 小米FireTV功能; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (FunctionSettingNow.MITVEnable) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-#if true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#if false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 读取PSN; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 byte[] result_psn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 byte[] data_psn; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4676,7 +4988,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            #endregion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#endregion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 生成IDM报文; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             keycontent = GenerateReportInfo(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4695,7 +5007,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            #region 波兰工厂DHA功能-抄写所有Key后执行Trigger和Check指令; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#region 波兰工厂DHA功能-抄写所有Key后执行Trigger和Check指令; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (FunctionSettingNow.DHA == true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Log.WriteInfoLog("Start to Trigger DHA..."); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4822,7 +5134,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 CommonMethod.ExportSNACASID(orderNow, SN, Encoding.ASCII.GetString(data)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            #region 小米FireTV功能; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#region 小米FireTV功能; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (FunctionSettingNow.MITVEnable) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (!ReportMIInfo(out error)) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4833,12 +5145,12 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            #endregion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#endregion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Thread.Sleep(FunctionSettingNow.Wait_after_completion); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             SetsuccessStatus(ResultStatus); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         end: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            #region 只有惠州工厂才启用G客户防呆措施; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#region 只有惠州工厂才启用G客户防呆措施; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (FunctionSettingNow.NTF) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 string strLastResult = ""; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4924,7 +5236,7 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     CommonMethod.GeneratKaylaData(FunctionSettingNow.Line, FunctionSettingNow.Station, OrderText.Text, SN, startTime, DateTime.Now, returnObject, keyInfo, TestResult != 0 ? true : false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            #endregion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#endregion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (TestResult == 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4977,119 +5289,120 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <returns></returns> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public bool UpdateKeys(Dictionary<string, string> keys, bool autokey) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            GetOrderRemainKeyCount(orderNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("DeviceID")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.DIDWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteDID, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("DeviceID", midListNow.clienttype, autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("DeviceID", midListNow.clienttype, autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("MAC")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.MacWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteMac, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("MAC", keys["MAC"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("MAC", keys["MAC"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("HDCP_KEY")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.HDCPWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteHDCP, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("HDCP_KEY", keys["HDCP_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("HDCP_KEY", keys["HDCP_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("CI_PLUS_KEY")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.CI_plusWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteCiplus, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("CI_PLUS_KEY", keys["CI_PLUS_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("CI_PLUS_KEY", keys["CI_PLUS_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("WiDi")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.WiDiWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteWiDi, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("WiDi", keys["WiDi"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("WiDi", keys["WiDi"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("Widevine_KEY")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.WidevineWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteWidevine, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("Widevine_KEY", keys["Widevine_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("Widevine_KEY", keys["Widevine_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("HDCP2.2_KEY")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.HDCP22Write_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteHDCP22, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("HDCP2.2_KEY", keys["HDCP2.2_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("HDCP2.2_KEY", keys["HDCP2.2_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("NETFILX_ESN")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.ESNWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteESN, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("NETFILX_ESN", keys["NETFILX_ESN"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("NETFILX_ESN", keys["NETFILX_ESN"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("Attestation_key")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.AttestationWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteAttestation, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("Attestation_key", keys["Attestation_key"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("Attestation_key", keys["Attestation_key"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("MGK_KEY")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.MGKWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteMGK, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("MGK_KEY", keys["MGK_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("MGK_KEY", keys["MGK_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("Fairplay_KEY")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.FairplayWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteFairplay, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("Fairplay_KEY", keys["Fairplay_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("Fairplay_KEY", keys["Fairplay_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("ECP_KEY")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.ECPWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteECP, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("ECP_KEY", keys["ECP_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("ECP_KEY", keys["ECP_KEY"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("WiFi_MAC")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.WifiMacWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteWifiMac, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("WiFi_MAC", keys["WiFi_MAC"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("WiFi_MAC", keys["WiFi_MAC"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("BT_MAC")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.BTMacWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteBTMac, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("BT_MAC", keys["BT_MAC"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("BT_MAC", keys["BT_MAC"], autokey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("LEK")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.LEKWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteLEK, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("LEK", keys["LEK"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("LEK", keys["LEK"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("PEK")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.PEKWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WritePEK, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("PEK", keys["PEK"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("PEK", keys["PEK"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("PlayReady_key")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.PlayreadyWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WritePlayready, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("PlayReady_key", keys["PlayReady_key"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("PlayReady_key", keys["PlayReady_key"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("Hashkey")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.HashWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteHash, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("Hashkey", keys["Hashkey"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("Hashkey", keys["Hashkey"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("YouTube_KEY")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.YouTubeWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteYouTube, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("YouTube_KEY", keys["YouTube_KEY"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("YouTube_KEY", keys["YouTube_KEY"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("DSN")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5110,35 +5423,929 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.ACASKeyWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteACASKey, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("ACAS_KEY", keys["ACAS_KEY"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("ACAS_KEY", keys["ACAS_KEY"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("DAK")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.DAKWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteDAK, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("DAK", keys["DAK"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("DAK", keys["DAK"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (keys.ContainsKey("FVP")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (cfg_writedone.FVPWrite_YesNo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SetCheckboxStatus(WriteFVP, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                UpdateKeyCountOnline("FVP", keys["FVP"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateKeyCount("FVP", keys["FVP"], false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// 在线获取key数量,更新Keycount 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// 获取key数量,更新Keycount 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <param name="key">key种类</param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <param name="keytype">key的具体类型</param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <returns></returns> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        public bool UpdateKeyCountOnline(string key, string keytype, bool autokey) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public bool UpdateKeyCount(string key, string keytype, bool autokey) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string url = midListNow.host; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string count; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string code; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string desc; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            HttpHelper http = new HttpHelper(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            HttpItem item = new HttpItem() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Encoding = Encoding.Default, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Method = "post", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                ContentType = "application/x-www-form-urlencoded" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            switch (key) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "DeviceID": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statdeviceid.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "devicetype=tcl_unknown_model"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetDeviceID count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(DIDCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(DIDCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteDID.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, "tcl_unknown_model"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, "tcl_unknown_model"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse DID count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(DIDCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get DID count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(DIDCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "MAC": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statmac.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "typeString=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetMac count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(MacCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(MacCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteMac.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse Mac count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(MacCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get Mac count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(MacCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "HDCP_KEY": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/stathdcpkey.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetHDCP_KEY count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(HDCPCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(HDCPCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteHDCP.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse hdcp count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(HDCPCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get hdcp count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(HDCPCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "CI_PLUS_KEY": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statcikey.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetCI_PLUS_KEY count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(CICount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(CICount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteCiplus.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parses ciplus count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(CICount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get ciplus count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(CICount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "WiDi": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statwidi.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetWiDi count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(WidiCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(WidiCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteWiDi.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse widi count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(WidiCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get widi count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(WidiCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "Widevine_KEY": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statWidevineAndAttestation.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetWidevine_KEY count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(WideVineCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(WideVineCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteWidevine.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse widevine count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(WideVineCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get widevine count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(WideVineCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "HDCP2.2_KEY": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/stathdcpkey2.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetHDCP2.2_KEY count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(HDCP22Count, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(HDCP22Count, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteHDCP22.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse hdcp22 count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(HDCP22Count, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get hdcp22 count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(HDCP22Count, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "NETFILX_ESN": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statnetfilxesn.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetNETFILX_ESN count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(ESNCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(ESNCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteESN.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse esn count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(ESNCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get esn count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(ESNCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "Attestation_key": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statWidevineAndAttestation.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetAttestation_key count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(AttestationCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(AttestationCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteAttestation.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parses attestation count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(AttestationCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get ciplus count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(AttestationCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "MGK_KEY": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statmgk.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetMGK count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(MGKCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(MGKCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteMGK.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse MGK count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(MGKCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get MGK count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(MGKCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "Fairplay_KEY": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statfairplay.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetFairplay_KEY count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(FairplayCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(FairplayCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteFairplay.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse Fairplay count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(FairplayCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get Fairplay count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(FairplayCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "ECP_KEY": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statecp.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetECP_KEY count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(ECPCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(ECPCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteECP.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse ECP count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(ECPCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get ECP count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(ECPCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "WiFi_MAC": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statmac.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "typeString=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetWifiMac count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(WifiMacCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(WifiMacCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteWifiMac.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse WifiMac count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(WifiMacCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get WifiMac count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(WifiMacCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "BT_MAC": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statmac.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "typeString=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetBTMac count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(BTMacCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(BTMacCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (autokey && WriteBTMac.Checked) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    int keycount = Convert.ToInt32(count.Replace(",", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (availableCount != "unknow") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        if (Convert.ToInt32(availableCount) > keycount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                            AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    else if (keycount < 500) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        AutoKeyRequire(this.Handle, key, keytype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse BTMac count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(BTMacCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get BTMac count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(BTMacCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "LEK": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statlek.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetLEK count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(LEKCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(LEKCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse LEK count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(LEKCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get LEK count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(LEKCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "PEK": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statpek.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetPEK count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(PEKCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(PEKCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse PEK count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(PEKCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get PEK count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(PEKCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "PlayReady_key": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statplayready.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetPlayReady_key count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(PlayreadyCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(PlayreadyCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse PlayReady_key count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(PlayreadyCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get PlayReady_key count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(PlayreadyCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "Hashkey": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/stathash.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetHashkey count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(HashCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(HashCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse Hashkey count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(HashCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get Hashkey count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(HashCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "YouTube_KEY": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statYoutubeKey.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetYoutubehkey count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(YouTubeCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(YouTubeCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse Youtube key count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(YouTubeCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get Youtube key count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(YouTubeCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "ACAS_KEY": // 获取ACAS KEY数量; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statAcasKey.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetACASkey count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(ACASKeyCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(ACASKeyCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse ACAS key count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(ACASKeyCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get ACAS key count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(ACASKeyCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                case "DAK": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        url1 = url + "/statdak.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        item.Postdata = "type=" + keytype; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            Log.WriteGetKeyLog("\r\nGetDAK count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (count == "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(DAKCount, count, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    SetKeyCountStatus(DAKCount, count, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                CommonMethod.ReportErrormsg("Fail to parse DAK count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                SetKeyCountStatus(DAKCount, code + "Error", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            CommonMethod.ReportErrormsg("Fail to get DAK count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SetKeyCountStatus(DAKCount, result.StatusDescription, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                default: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// 获取订单可用key余量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <param name="order">订单号</param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <returns></returns> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public bool GetOrderRemainKeyCount(string order) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string url = midListNow.host; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string count; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string code; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string desc; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (!CommonMethod.HTTPChecker(url)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            HttpHelper http = new HttpHelper(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            HttpItem item = new HttpItem() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Encoding = Encoding.Default, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Method = "post", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                ContentType = "application/x-www-form-urlencoded", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Timeout = 3000 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            url1 = url + "/getAvailableKeyCount.do?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.URL = url1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.Postdata = "ordernum=" + order; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            HttpResult result = http.GetHtml(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (result.StatusCode == System.Net.HttpStatusCode.OK) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Log.WriteGetKeyLog("\r\nGetOrderRemainKeyCount count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    availableCount = count.Replace(",", ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    availableCount = "unknow"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    CommonMethod.ReportErrormsg("Fail to parse GetOrderRemainKeyCount", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                availableCount = "unknow"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                CommonMethod.ReportErrormsg("Fail to get GetOrderRemainKeyCount", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// 按键触发在线抄写 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// 注意:此按键的作用是给不需要输入SN号的工厂使用; 
			 |