App_Code/UpLoadIMG.cs
(完整代码) 1KBusing System;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Net;
using System.Web;
//下载于51aspx.com
/// <summary>
///UpLoadIMG 的摘要说明
/// </summary>
public class UpLoadIMG
{
/**/
/// <summary>
/// 根椐Html内空自动识别图像文件,并下载到服务器指定目录
/// </summary>
/// <param name="strHTML"></param>
/// <param name="path"></param>
/// <returns></returns>
public string SaveUrlPics(string imgurlAry, string path)
{
string strHTML="";
try
{
string preStr = "";
//WebRequest req = WebRequest.Create(imgurlAry[i]);
preStr = System.DateTime.Now.ToString() + "_";
preStr = preStr.Replace("-", "");
preStr = preStr.Replace(":", "");
preStr = preStr.Replace(" ", "");
WebClient wc = new WebClient();
wc.DownloadFile(imgurlAry, HttpContext.Current.Server.MapPath(path + "/" + preStr + imgurlAry.Substring(imgurlAry.LastIndexOf("/") + 1)));
strHTML = preStr + imgurlAry.Substring(imgurlAry.LastIndexOf("/") + 1);
}
catch (Exception ex)
{
//return ex.Message;
}
return strHTML;
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。