今天在论坛上看到有朋友需要取得tag的值,很多人回复都是以正则来取。Insus.NET想了一下,它的字符串即是xml的节点。
只即需要转为xml之后,就可以很容易取得src的值:
string str="<IMG height=\"372\" alt=\"aa\" src=\"http://192.168.1.72/WebAdmin/images/image.jpg\" width=\"594\" border=\"0\" />";
XmlDocument xDoc = new XmlDocument();
xDoc.Load(new System.IO.MemoryStream(System.Text.Encoding.GetEncoding ("UTF-8").GetBytes (str)));
XmlNodeList xNode = xDoc.SelectNodes("//IMG");
{
for (int i = 0; i < xNode.Count; i++)
{
Response.Write ( xNode[i].Attributes["src"].Value);
}
}
分享到:
相关推荐
string JSON = XmlToJSON.Converter.XmlToJSON(xmlDoc); 示例: XmlDocument doc = new XmlDocument(); //doc.LoadXml(@"<root>aaa</root>"); doc.Load(@"C:\xxx.xml"); // Convert XML to a JSON string string ...
将插件安装到android studio 中 选择String.xml点击右键->convert to other languanger可以生成多国语言xml.亲测可用
j2SE,J2ME,J2EE,Android,java范围技术交流,iso shsh文件备份和直接通过浏览器下载iphone游戏和或者软件包 ios在解锁或者备份shsh文件时,从手机里获取的... PropertyListParser.convertToXml(file, file1); } }
将xml字符串转换成DataTable 3、public static DataSet CXmlFileToDataSet(string xmlFilePath)将xml文件转换成DataSet 4、public static DataTable CXmlToDataTable(string xmlFilePath, int tableIndex)将...
代码如下: //convert string to xml object function String2XML(xmlString) { // for IE if (window.ActiveXObject) { var xmlobject = new ActiveXObject(“Microsoft.XMLDOM”); xmlobject.async = “false”; ...
Nala 是一个基于Java的XML对象绑定工具,支持将Java对象序列... //convert Object to XML String xml = Xml.toXML(map, "utf8", true); } catch (IOException e) { } } } 标签:nala
string com = "Delete from tb_Reply where ID='" + Convert.ToInt32(strid) + "'"; SqlData da = new SqlData(); da.ExceSQL(com); Page.Response.Redirect("LeaveWordView.aspx?ID="+Request["ID"].ToString()...
Failed to load uk.ltd.getahead.dwr.convert.JDOMConverter. Cause: org/jdom/Document 因为DWR没有办法知道你是否采用jdom converter,所以提示信息是info级别.如果你想采用jdom converter,你必须很清楚地知道jdom...
Result = Convert.ToBase64String(CypherTextBArray); return Result; } catch (Exception ex) { throw ex; } } //RSA的加密函数 public string RSAEncrypt(string xmlPublicKey, byte[] EncryptString) ...
XML writer: convert documents to tagged XML format. See https://github.com/hjiang/jsonxx/issues/12 for details. Compiler version You need a modern C++ compiler. For older compilers, please try ...
类型转换器 以下 go 类型之间的转换... // convert time to string t1 , _ := time . Parse ( time . RFC3339 , "2011-01-26T18:53:18+01:00" ) conv . Convert ( t1 , & s ) fmt . Println ( s ) // 2011-01-
public static XmlDocument ReadFileXML(string mFilePath) { XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.PreserveWhitespace = true; xmlDoc.Load(mFilePath); } catch (Exception err) { ...
到细胞风景 一个npm模块,可将基于xml的系统... let cyGraph = convert ( fileString ) ; } ) ; 要全面了解如何使用此模块,请查看文件夹。 失误 向转换器提供无效的sbgnml文本将导致引发错误。 let convert = requi
在布局文件中 , 选中根布局的标签 , 按住Alt + 回车键 , 点击 Convert to data binding layout , 即可转化成 dataBinding的布局 dataBinding 也支持在布局文件中使用数组、List、Set 和 Map , 且在布局文件中都...
事出有因 ...将图片转化为Base64字符串的流程是:首先使用BinaryFormatter将图片文件序列化为二进制数据,然后使用Convert类的ToBase64String方法。将Base64字符串转换为图片的流程正好相反:使用Convert
咕噜咕噜转换 在 XML、JSON 和 YAML 之间转换,从一种格式到另一种格式。入门如果您以前没有使用过 ,请务必查看指南。 从与项目的和相同的目录中,使用以下命令安装此插件: npm install grunt-convert --save-dev ...
You can use these functions to insert a file into the active file, insert a string into the file at every specified increment, sample colors from anywhere on your screen, and more. Using Bookmarks ...
2.Convert.ToInt32(); 与Int32.Parse的区别 3. Subst命令的使用 4.Button控件的onclick、oncommand、commandname、CommandArgument的区别 . . . Ajax(Asynchronous JavaScript + XML)的定义 使用模型窗口时,...
strings.xml) to your target languages automactically. Help developers localize their Android app easily, with just one click. Usage Right click the strings resource file, choose 'Convert to other ...
该项目利用了安装Install-Package cs-ifc-exporter用法下面的示例代码显示了如何使用IfConvert将IFC文件转换为OBJ,XML或其他格式: using System ;using System . Collections . Generic ;using System . Linq ;...