'載入物件,bin/ 要放入 .dll
Imports HtmlAgilityPack
'*********************
Dim html As New HtmlDocument()
html.LoadHtml("...一大塊HTML,可以是整個網頁,也可以是html區塊...")
'找出所有img tag
Dim imgNodes As HtmlNodeCollection = html.DocumentNode.SelectNodes("//img")
For Each node As HtmlNode In imgNodes
Dim strUrl As String = node.GetAttributeValue("src", "")
......
Next
<script type="text/javascript">
CKEDITOR.replace('Content', { toolbar: 'basic', height: 200 });
</script>
<script type="text/javascript">
CKEDITOR.replace('Content, { toolbar: 'basic', height: 360, allowedContent: {
img: {
attributes: '!src, alt', // src is required
styles: 'height, width'
}
}
});
</script>
/* Find Collation of SQL Server Database */
SELECT DATABASEPROPERTYEX('DBName', 'Collation')
GO
/* Find Collation of SQL Server Database Table Column */
USE sample
GO
SELECT name, collation_name
FROM sys.columns
WHERE OBJECT_ID IN (
SELECT OBJECT_ID FROM sys.objects WHERE type = 'U' AND name = 'TableName')
AND name = 'ColumnName'
Encoding enc = Encoding.UTF8; XmlWriterSettings xws = new XmlWriterSettings(); xws.Encoding = enc; xws.Indent = true; MemoryStream ms = new MemoryStream(); string strXml = ""; using (XmlWriter writer = XmlWriter.Create(ms, xws)) { writer.WriteStartDocument(); writer.WriteStartElement("rss"); writer.WriteAttributeString("version", "2.0"); writer.WriteStartElement("channel"); // channel data writer.WriteElementString("title", "最新文章"); ...(XML 資料)...... writer.WriteEndElement(); // channel end writer.WriteEndElement(); //rss end writer.WriteEndDocument(); writer.Flush(); StreamReader reader = new StreamReader(ms, enc, true); ms.Seek(0, SeekOrigin.Begin); strXml = reader.ReadToEnd(); }