|
@@ -2133,7 +2133,7 @@ namespace MOKA_Factory_Tools
|
|
|
HttpHelper http = new HttpHelper();
|
|
|
HttpItem item = new HttpItem()
|
|
|
{
|
|
|
- Encoding = Encoding.Default,
|
|
|
+ Encoding = Encoding.UTF8,
|
|
|
Method = "post",
|
|
|
ContentType = "text/xml",
|
|
|
KeepAlive = false
|
|
@@ -2160,24 +2160,6 @@ namespace MOKA_Factory_Tools
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 将url utf8转gb2312;
|
|
|
- /// </summary>
|
|
|
- /// <param name="text"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public static string utf8_gb2312(string text)
|
|
|
- {
|
|
|
- //声明字符集
|
|
|
- System.Text.Encoding utf8, gb2312;
|
|
|
- //utf8
|
|
|
- utf8 = System.Text.Encoding.GetEncoding("utf-8");
|
|
|
- //gb2312
|
|
|
- gb2312 = System.Text.Encoding.GetEncoding("gb2312");
|
|
|
- byte[] data = System.Text.Encoding.Convert(utf8, gb2312, utf8.GetBytes(text));
|
|
|
- //返回转换后的字符
|
|
|
- return utf8.GetString(data);
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 上报数据抄写结果到MES系统中;
|
|
|
/// </summary>
|
|
@@ -2194,7 +2176,7 @@ namespace MOKA_Factory_Tools
|
|
|
HttpHelper http = new HttpHelper();
|
|
|
HttpItem item = new HttpItem()
|
|
|
{
|
|
|
- Encoding = Encoding.Default,
|
|
|
+ Encoding = Encoding.UTF8,
|
|
|
Method = "post",
|
|
|
ContentType = "application/json",
|
|
|
KeepAlive = false
|
|
@@ -2208,7 +2190,6 @@ namespace MOKA_Factory_Tools
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- hResult.Html = utf8_gb2312(hResult.Html);
|
|
|
using (JsonTextReader reader = new JsonTextReader(new StringReader(hResult.Html)))
|
|
|
{
|
|
|
JObject jObject = (JObject)JToken.ReadFrom(reader);
|
|
@@ -2229,13 +2210,13 @@ namespace MOKA_Factory_Tools
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
msg = e.Message;
|
|
|
- Log.WriteErrorLog("ReportDataBurningResultToMES error:" + hResult.StatusDescription + "\r\n" + hResult.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata);
|
|
|
+ Log.WriteErrorLog("ReportDataBurningResultToMES Json-error:" + hResult.StatusDescription + "\r\n" + hResult.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
msg = hResult.StatusDescription;
|
|
|
- Log.WriteInfoLog("ReportDataBurningResultToMES error:" + hResult.StatusDescription + "\r\n" + hResult.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata);
|
|
|
+ Log.WriteInfoLog("ReportDataBurningResultToMES Http-error:" + hResult.StatusDescription + "\r\n" + hResult.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata);
|
|
|
}
|
|
|
|
|
|
// 没有进行数据库查重:惹数据已添加过,同一次FSN抄写多次失败后导致多条记录。
|
|
@@ -2299,7 +2280,7 @@ namespace MOKA_Factory_Tools
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
- #endregion
|
|
|
+#endregion
|
|
|
}
|
|
|
|
|
|
/// <summary>
|