|
@@ -233,5 +233,46 @@ namespace MySystem
|
|
|
return decimal.Parse(str);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ #region 获取网络文件内容
|
|
|
+
|
|
|
+ public static string GetNetFileContent(string url)
|
|
|
+ {
|
|
|
+ string textContent = "";
|
|
|
+ using (var client = new System.Net.WebClient())
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ textContent = client.DownloadString(url);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "获取网络文件内容异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return textContent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static byte[] GetNetFileData(string url)
|
|
|
+ {
|
|
|
+ byte[] textContent = new byte[] { };
|
|
|
+ using (var client = new System.Net.WebClient())
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ textContent = client.DownloadData(url);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "获取网络文件流异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return textContent;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|