Extract the image address in the cuteeditor and save the remote image to your local device.

Source: Internet
Author: User

Autoconfigure with a property
If you select one of them, the buttons will be different and can be customized.

This article from <a href = 'HTTP: // www.soidc.net '> IDC Expert Network </a> original article: http://www.soidc.net/discuss/5/060815/10/428252_1.html

To customize the settings, go to the cutesoft_clientcuteeditorconfigurationautoconfigure folder.
Next, modify one of them and select it.
For example, modify minimal. config.
<Item name = "editing" value = "false"/>
<Item name = "format" value = "false"/>
<Item name = "insert" value = "false"/>
<Item name = "insertadvanced" value = "false"/>
<Item name = "insertfiles" value = "false"/>
<Item name = "insertforms" value = "false"/>
<Item name = "relative" value = "false"/>
<Item name = "tags" value = "false"/>
<Item name = "verbs" value = "false"/>
Remove an item and it will not be displayed.

This article from <a href = 'HTTP: // www.soidc.net '> IDC Expert Network </a> original article: http://www.soidc.net/discuss/5/060815/10/428252_1.html

 

 

String STR = " ";
String STR = "<input type = \" image \ "Height = \" 325 \ "width = \" 500 \ "src = \" FCKeditor/Editor/filemanager/connectors/aspx /userfiles/image/b011627669461283b6a55b8611153813.jpg \ "/> ";
System. Text. regularexpressions. RegEx Reg = new system. Text. regularexpressions. RegEx (@ "<input [^>]. *? Src = ""(? <SRC> [^ ""]. *) "" [^>]. *?> ", System. Text. regularexpressions. regexoptions. ignorecase );
System. Text. regularexpressions. RegEx Reg = new system. Text. regularexpressions. RegEx (@ "]. *? Src = ""(? <SRC> [^ ""]. *) "" [^>]. *?> ", System. Text. regularexpressions. regexoptions. ignorecase );
System. Text. regularexpressions. matchcollection M = reg. Matches (STR); // you can specify the string to be searched.
System. Text. regularexpressions. matchcollection M = reg. Matches (STR); // you can specify the string to be searched.
For (INT I = 0; I <M. Count; I ++)
{
Response. Write (M [I]. Groups ["src"]. tostring () + "<br> ");
}

String STR = "here is what you read from the database, including HTML tags of many images (such as System. Text. regularexpressions. RegEx Reg = new system. Text. regularexpressions. RegEx (@ "]. *? Src = ""(? <SRC> [^ ""]. *) "" [^>]. *?> ", System. Text. regularexpressions. regexoptions. ignorecase );
System. Text. regularexpressions. matchcollection M = reg. Matches (STR); // you can specify the string to be searched.
For (INT I = 0; I <M. Count; I ++)
{
Response. Write (M [I]. Groups ["src"]. tostring () + "<br> ");
}

// Extract the image address in the cuteeditor and save the remote image to the local device.
RegEx Re = new RegEx (@ "src \ s * = \ s *(? :( ["" ']) (? <SRC> [^ "" '] +) \ 1 | (? <SRC> [^ \ s>] +) ", regexoptions. ignorecase | regexoptions. singleline );
Matchcollection MC = Re. Matches (this. editor1.xhtml. tostring ());
Foreach (Match m in MC)
{
String url = M. Groups ["src"]. value;
String filepath = URL;
If (URL. substring (0, 7). tolower () = "http ://")
{
String kuozhangming = "." + URL. substring (URL. lastindexof (".") + 1 );
String Path = httpcontext. Current. server. mappath (@ "/mlxz/uploads/download /");
String filename = datetime. Now. tostring ("yyyymmddhhmmss") + kuozhangming;
Path = path + filename;
Mailto: filepath = @ % 22/mlxz/uploads/download/% 22 + filename;
WebClient mywebclient = new WebClient ();
Mywebclient. downloadfile (URL, PATH );
This. editor1.text = This. editor1.xhtml. tostring (). Replace (URL, filepath );
}
PIC. Items. Add (New listitem (filepath, filepath ));
}

 

 

String STR = "here is what you read from the database, including HTML tags of many images (such as String [] STEs = new string [] {}; // an array
System. Text. regularexpressions. RegEx Reg = new system. Text. regularexpressions. RegEx (@ "]. *? Src = ""(? <SRC> [^ ""]. *) "" [^>]. *?> ", System. Text. regularexpressions. regexoptions. ignorecase );
System. Text. regularexpressions. matchcollection M = reg. Matches (STR); // you can specify the string to be searched.
For (INT I = 0; I <M. Count; I ++)
{
STEs [I] = m [I]. Groups ["src"]. tostring ();

}

This. dropdownlist1.datasource = STEs;
This. dropdownlist1.databind ();

List <string> SWD = new list <string> ();
For (INT I = 0; I <M. Count; I ++)
{

SWD. Add (M [I]. Groups ["src"]. tostring ());
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.