|
|
@@ -4,6 +4,8 @@ using System.Web;
|
|
4
|
4
|
using System.Web.UI.HtmlControls;
|
|
5
|
5
|
using System.Drawing;
|
|
6
|
6
|
using System.Net;
|
|
|
7
|
+using System.Security.Cryptography.X509Certificates;
|
|
|
8
|
+using System.Net.Security;
|
|
7
|
9
|
|
|
8
|
10
|
namespace CallCenter.Utility
|
|
9
|
11
|
{
|
|
|
@@ -690,15 +692,16 @@ namespace CallCenter.Utility
|
|
690
|
692
|
}
|
|
691
|
693
|
}
|
|
692
|
694
|
#endregion
|
|
693
|
|
-
|
|
|
695
|
+
|
|
694
|
696
|
#region url下载文件并保存本地
|
|
695
|
697
|
public string downloadurl(string url, string filename)
|
|
696
|
698
|
{
|
|
697
|
699
|
try
|
|
698
|
700
|
{
|
|
|
701
|
+
|
|
699
|
702
|
WebClient mywebclient = new WebClient();
|
|
|
703
|
+ System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
|
700
|
704
|
byte[] Bytes = mywebclient.DownloadData(url);
|
|
701
|
|
-
|
|
702
|
705
|
if (!Directory.Exists(_SavePath)) Directory.CreateDirectory(_SavePath);
|
|
703
|
706
|
|
|
704
|
707
|
using (var fs = new FileStream(_SavePath + filename, FileMode.Create))
|