问题描述
给位高手帮帮我好急我单独做一个页用publicpartialclass_Default:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){Regexre=newRegex(@"srcs*=s*(?:([""'])(?<src>[^""']+)1|(?<src>[^s>]+))",RegexOptions.IgnoreCase|RegexOptions.Singleline);MatchCollectionmc=re.Matches(this.Editor1.XHTML.ToString());foreach(Matchminmc){stringurl=m.Groups["src"].Value;stringfilepath=url;if(url.Substring(0,7).ToLower()=="http://"){stringKuoZhangMing="."+url.Substring(url.LastIndexOf(".")+1);stringpath=HttpContext.Current.Server.MapPath(@"./Uploads/Download/");stringfilename=DateTime.Now.ToString("yyyyMMddHHmmss")+KuoZhangMing;path=path+filename;filepath=@"./Uploads/Download/"+filename;WebClientmyWebClient=newWebClient();myWebClient.DownloadFile(url,path);this.Editor1.Text=this.Editor1.XHTML.ToString().Replace(url,filepath);}//Pic.Items.Add(newListItem(filepath,filepath));}}可以取出图片但放到我的产品提交页面就不行知道怎么回事
解决方案
解决方案二:
你先说一下你的错误,我估计跟我碰到的一样你要包含这两个类usingSystem.Net;usingSystem.Text.RegularExpressions;