UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-#Author#
[所有文章分類]
所有文章分類
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (20)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (24)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
最新回應
  • Newtonsoft.Json.JsonConvert.DeserializeObject 失敗的情況
    test...more
  • dotnet ef dbcontext scaffold
    ...more
  • [ASP.NET] 利用 aspnet_regiis 加密 web.config
    ...more
  • IIS ARR (reverse proxy) 服務安裝
    ...more
  • [錯誤訊息] 請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)
    ...more
  • 用 Javascript 跨網頁讀取 cookie (Cookie cross page, path of cookie)
    ...more
  • 線上客服 - MSN
    本人信箱被盜用以致資料外洩,是否可以請貴平台予以協助刪除該信箱之使用謝謝囉...more
  • 插入文字到游標或選取處
    aaaaa...more
  • IIS 配合 AD (Active Directory) 認証, 使用 .Net 6.0
    太感謝你了~~~你救了我被windows 認證卡了好幾天QQ...more
  • PostgreSQL 的 monitor trigger
    FOR EACH ROW 可能要改為 FOR EACH STATEMENT ...more
標籤
  • 0,
  • 284
  • 732
  • 266
  • 2625
  • ad
  • a
  • Table
  • [u2]
  • [U2],
  • ARR
  • asp.net4.0
  • 56
  • 18
  • SQL
  • date[t],
  • -5103 UNIO
  • Image
  • .
  • 20
  • 使用者
  • 網址
  • -8908
  • C
  • ? ORDER BY
  • git
  • asp
  • hhhh
  • 868
  • 8330
  • web
  • sing
  • 476
  • UNT
  • 2446
  • C#
  • free
  • max
  • Scaffold
  • gpo
  • IP
  • structure
  • aspx
  • ajax ORDER
  • CKED
  • Vue
  • win
  • Data
  • aGoELisk
  • image,
頁數 3 / 4 上一頁 下一頁
搜尋 sing 結果:
.NET Html Parser (HtmlAgilityPack)
之前做一些專案時,會有需要去爬別人的網站。
例如找出網頁某個區塊把他截錄到資料庫
HtmlAgility Pack 是不錯的工具
http://msdn.microsoft.com/zh-tw/evalcenter/ee787055.aspx

使用上,就有點像是操作 XmlDocument 一樣
一些常用的語法 SelectNodes, SelectSingleNode 幾乎一樣
也有跟 XPath 一樣的操作方法,很方便

'載入物件,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
​
More...
darren, 2014/9/23 下午 02:35:23
[轉]強迫網站轉向到 HTTPS 加密安全連線 ( IIS URL Rewrite )
參考網址:http://blog.miniasp.com/post/2014/06/04/Redirect-to-HTTPS-from-HTTP-using-IIS-URL-Rewrite.aspx
More...
Reiko, 2014/6/4 下午 11:06:28
SQL Server log 檔案過大
參考來源:http://seasuwang.blogspot.tw/2009/09/sql-server-log.html

SQL Server 2008 Transcation log 檔案太大,導致SQL Server無法運作
將SQL Server的執行程序停止,手動刪除log實體檔案,再次啟動SQL Server的程序,資料庫沒辦法work

參考 Seasu Wang 說明把資料庫給救回來,步驟如下:
假設資料庫名稱為OhMyGod
1. 停止SQL Server, 將原mdf檔移走
2. 開啟SQL Server, 建立新的OhMyGod資料庫.
3. 停止SQL Server
4. 將損壞的mdf覆蓋回新建的mdf檔,並刪除新建的log檔
5. 開啟SQL Server
3. 設定OhMyGod資料庫狀態為EMERGENCY:
ALTER DATABASE OhMyGod SET EMERGENCY
4. 設定OhMyGod資料庫模式為"單一使用者":
sp_dboption 'OhMyGod', 'single user', 'true'
5. 檢查指定資料庫中所有物件的配置、結構和邏輯完整性:
DBCC CHECKDB (OhMyGod, REPAIR_ALLOW_DATA_LOSS)
6. 還原OhMyGod資料庫模式:
sp_dboption 'OhMyGod', 'single user', 'false'
7. 設定OhMyGod資料庫狀態為
ONLINE:ALTER DATABASE OhMyGod SET ONLINE
 
More...
Reiko, 2014/3/21 上午 11:52:10
修正 CKEditor img tag 被拿掉
參考: http://stackoverflow.com/questions/16832513/problems-with-image-tag-when-using-ckeditor


原:
<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>
More...
Reiko, 2013/12/4 下午 02:54:37
Direct Server Return on Windows 2008 using loopback adpter (server load balance)
要執行以下的指令:

netsh interface ipv4 set interface "net" weakhostreceive=enabled
netsh interface ipv4 set interface "loopback" weakhostreceive=enabled
netsh interface ipv4 set interface "loopback" weakhostsend=enabled

其中 "net" 是外接網卡的名稱,"loopback"是虛擬網站的名稱。

請參考: http://blog.loadbalancer.org/direct-server-return-on-windows-2008-using-loopback-adpter/
More...
Bike, 2013/10/27 上午 11:33:00
SessionState 效能影響問題
昨天Peter提到同一個 Session 只能一次 Request一個 Page
發現這篇文章有描述 http://blog.darkthread.net/post-2011-08-27-aspx-session-lock.aspx
主要是為了保持Session Data一致性 所以要 Lock Session

所以網頁綁 SessionState 是會影像效能的,尤其使用 StateServer 或 SqlServer 方式影響更大
一般.aspx 預設是有的,所以 aspx 有個 EnableSessionState 可以處理是否綁 SessionState
True: 可 Read, Write
ReadOnly: 可 Read
False: 完全不綁定 Session
如果網頁完全用不到 Session,可以考慮把她關閉,效能會好一點,但要注意相關程式碼、元件是否有用到,不然會有Exception

另外 web handler (.ashx) 預設是不綁 Session 的,對於單純的程式處理(例如 Ajax),建議用.ashx
但是在某些狀況下,.ashx 可能需要用到 Session
這時就要import( or using) Web.SessionState, 然後 Class 實作 IRequiresSessionState Interface
就OK啦
More...
darren, 2013/7/12 上午 10:24:57
Find Collation of Database and Table Column Using T-SQL
/* 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'


參考:http://blog.sqlauthority.com/2008/12/16/sql-server-find-collation-of-database-and-table-column-using-t-sql/
More...
Reiko, 2013/5/15 上午 10:30:53
SQL 2008 資料庫的復原
1. "有疑問"的 資料庫的修復:

ALTER DATABASE MyDB SET EMERGENCY;
DBCC checkdb('MyDB');
ALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DBCC CheckDB ('MyDB', REPAIR_ALLOW_DATA_LOSS);
ALTER DATABASE MyDB SET MULTI_USER;

其中 "DBCC CheckDB ('MyDB', REPAIR_ALLOW_DATA_LOSS)" 可能要多執行幾次。

2. Restore Differential Backup 用的 SQL:
​
RESTORE DATABASE [MyDB] FROM  DISK = N'D:\BACKUP_DB\MyDB_backup.bak' WITH  FILE = 1,  NORECOVERY,  NOUNLOAD,  REPLACE,  STATS = 10,
MOVE 'MyDB_Data' TO 'D:\SQLDB2008\MyDB.mdf', 
MOVE 'MyDB_Log' TO 'D:\SQLDB2008\MyDB.ldf'

RESTORE DATABASE [MyDB] FROM  DISK = N'D:\BACKUP_DIFF\MyDB_backup_2013_02_25_12.bak' WITH  FILE = 1,  NOUNLOAD, NORECOVERY,  STATS = 10

RESTORE DATABASE [MyDB] WITH RECOVERY (正在還原的資料庫也可以用這個指令來恢復成可使用的狀態)
More...
Bike, 2013/2/26 上午 10:58:40
使用 Drag Drop 將檔案放入網頁上傳檔案 (HTML5)
  • How to Use HTML5 File Drag & Drop
  • How to Open Dropped Files Using HTML5 and JavaScript
  • How to Asynchronously Upload Files Using HTML5 and Ajax
  • How to Create File Upload Progress Bars in HTML5 and JavaScript

這幾篇文章提到使用拖拉方式將檔案放到網頁裡面
然後在本地端預覽,然後ajax上傳,上傳時還有 progress bar
一整套運作模式說明,並附上sample code,挺棒的
附檔sample code

-------------------------------------------
測試後補充:
1. 範例中的 dragover event 要改成 dragenter 比較正確
然後 dragover 最好是做成 return false (ev.stopPropagation())
2. Server端不能用Requst.Files收檔案,要直接處理 Request.InputStream另存成檔案

 
More...
darren, 2012/10/7 上午 01:20:42
XmlWriter 之 UTF-16 問題
當我們使用 XmlWriter 配合 StringBuilder 建立xml文件時,會產生結果是 UTF-16 的 xml 文件
即使 XmlWriter 有配合 XmlWriterSetting 設定為 UTF-8 但結果還是 UTF-16
我網路上找了一下解決方式 整理出以下是比較好的解決方式 請參考程式碼
最終還是要靠 StreamReader 轉一次

        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();
        }
More...
darren, 2012/8/9 下午 12:56:25
|< 1234 >|
頁數 3 / 4 上一頁 下一頁
~ Uwinfo ~