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
標籤
  • win
  • exception
  • 2446
  • 試題
  • 54
  • 擋IP
  • 1
  • minvalue
  • Rss2
  • VB轉C#
  • PID2121121
  • 1312
  • 492
  • PDQ
  • sqltransac
  • 0x42121121
  • exten
  • sql
  • 6361
  • -3849
  • iis2121121
  • JFZoJWOB
  • skype
  • aspx ORDER
  • SSMS
  • needlock
  • 403 - forb
  • 0xe0434352
  • -6532
  • 48
  • CSP
  • -1870
  • formhelper
  • 1455
  • 執行緒
  • U2
  • column
  • 光
  • q8VQO2HG
  • qrcode
  • jquery XSS
  • ip
  • tim2121121
  • dm_exec_sq
  • 6342121121
  • dependency
  • ie
  • replace
  • itextsharp
  • AjaxUpload
頁數 24 / 39 上一頁 下一頁
搜尋 ti 結果:
Fixing Windows 2008 R2 Activation Errors
http://lifeofageekadmin.com/fixing-windows-2008-r2-activation-errors/

​Location is at C:\windows\system32\Slmgr.vbs
/ckms = clear all KMS servers in cache and set to auto discover
/skms :  = Specify a KMS host server
/ipk  = Enter in a new license key
/ato = Activate the new key
/dlv = Display license information
First open a command prompt and try to register a license key. This example is for Windows 2008 R2 Enterprise Edition.
C:\> Cd c:\windows\system32
C:\Windows\system32>cscript slmgr.vbs /ipk
C:\Windows\system32>cscript slmgr.vbs /ato
If you receive activation successful you are complete. If you receive a 0xC004F074 error do the following.
C:\> Cd c:\windows\system32
C:\Windows\system32>cscript slmgr.vbs /ckms
C:\Windows\system32>cscript slmgr.vbs /ipk
C:\Windows\system32>cscript slmgr.vbs /ato
If you receive activation successful you are complete. If you receive a 0xC004F074 error again or another error do the following.
C:\> Cd c:\windows\system32
C:\Windows\system32>cscript slmgr.vbs /rilc
Reboot
C:\> Cd c:\windows\system32
C:\Windows\system32>cscript slmgr.vbs /ckms
C:\Windows\system32>cscript slmgr.vbs /ipk
C:\Windows\system32>cscript slmgr.vbs /ato
More information can be found at Configuring KMS Clients
More...
Bike, 2014/11/3 下午 04:49:25
IsNumeric 以及 Convert.ToInt32(char) 要注意的狀況
最近做一些int型別轉換的時候,發現一些現象,以後寫code的時候要注意

1. VB.NET IsNumeric 用逗號可以過,例如 IsNumeric("1234,5678") ==> True
   但是轉型別 CInt or Convert.ToInt32 就會出錯,所以用 IsNumeric 不是很保險,最好用 int.TryParse

2. Convert.ToInt32(char) 會抓出該 char 的 ascii code, 而不是該文字代表的數字
   Convert.ToInt32('9') ==> 57  (C# 用單引號代表是 char)
   Convert.ToInt32("9") ==> 9
   Convert.ToInt32('A') ==> 65  (C# 用單引號代表是 char)
   Convert.ToInt32("A") ==> error: 輸入字串格式不正確。
More...
darren, 2014/10/28 下午 07:10:28
新版Chrome location.reload() 問題
location.reload()

Chrome 最新的版本 
會把 本來的表單重送,所以我在 
UW.WU.ShowMessageAndRefresh 
 
System.Web.HttpContext.Current.Response.Write("location.reload()" & vbCrLf)

更改為
System.Web.HttpContext.Current.Response.Write("location.href=location.href" & vbCrLf)


 
More...
瞇瞇, 2014/10/20 下午 03:17:32
IIS 擋 IP 之機制無法完全阻擋攻擊

昨晚突然出現大量的Exception,發現是某個IP攻擊網站,所以就直接使用IIS擋IP方式阻擋該IP的攻擊,但是設定之後,發現Exception還是一直出來。但是束手無策....直到一個多小時後才停止攻擊。

事後翻出IIS Log看結果



發現IIS擋IP有發揮作用(status:403) 但是會有漏網之魚(status:302-其實status是500)
檢查 "23:10:46" 一秒內受到 36 次攻擊 但是漏掉了 8 個 -> 失敗率約兩成

結論:
1. 對於阻斷攻擊,可能還需要程式上做處理,例如 begin_request 時檢查
2. Log Parser 真是看 log 最佳工具....

More...
darren, 2014/10/16 下午 07:13:18
適用於手機版網頁的 facebook feed 機制

對於PC版大尺吋的螢幕,當網站要 feed 資料到 facebook 時,可以使用 javascript SDK 的
FB.ui => method:'feed' 方式處理,參考位置。此方法會popup小視窗讓user可以分享資料出去。

但是遇到手機版網頁就有點麻煩,實測上手機版的 chrome 會出現轉不停的情況,無法分享;而iPhone則是另開新頁面處理,可以成功但是會多一個分頁。所以手機版網頁建議使用 redirect 方式處理分享機制,參考位置
​

    var fbUrl = "https://www.facebook.com/dialog/feed?" +
    "app_id=122465741241119&display=touch" +
    "&link=" + encodeURIComponent("http://www.shopunt.com/tch/FixPage.aspx?id=525") +
    "&picture=" + encodeURIComponent("http://www.shopunt.com/tch/event/2014-nail-enrollment/fb_200x200.jpg") +
    "&description=" + encodeURIComponent("市價不斐的光療DIY教學,UNT傾囊相授!10場巡迴免費教學,讓妳輕鬆掌握光療DIY訣竅,並搶先體驗秋冬最新流行色!現場打卡,再送時尚美甲工具組") +
    "&redirect_uri=" + encodeURIComponent("http://www.shopunt.com/tch/event/2014-nail-enrollment/Handler.ashx?fun=FBCallback");
​

當然以 redirect 處理與 javascript 方式處理是兩種不同的方式,redirect 方式的 callback 網址 (redirect_uri)要接收facebook 導回的 post_id , javascript 方式則是 callback function 處理 post_id

More...
darren, 2014/10/16 下午 03:48:04
SQL 搜尋時發生的奇怪現象與解決方法

半夜被老闆 Line,跟我說網頁發生錯誤,他無法看統計報表,會出現作業逾時的錯誤 我查了一下網頁程式,發現是這筆SQL指令跑太久
 Select Id, (IsNull(Total, 0) - IsNull(CouponDiscount, 0) + IsNull(CouponAdd, 0)) as Total, Buyer_Email, EN_Packing_List_Status, EN_Order_Source, En_Stock_Status, Create_Date
From V_Order_main With(Nolock)
Where Id in (select Order_Id from Ad_Trace With(NoLock) where (Parameter_Id = 14278))
AND Create_Date >= '2014/10/3' And Create_Date < '2014/10/12'

--> 跑了50秒~ 1分鐘

 Select Id, (IsNull(Total, 0) - IsNull(CouponDiscount, 0) + IsNull(CouponAdd, 0)) as Total, Buyer_Email, EN_Packing_List_Status, EN_Order_Source, En_Stock_Status, Create_Date
From V_Order_main With(Nolock)
Where Id in (select Order_Id from Ad_Trace With(NoLock) where (Parameter_Id = 14278))

--> 拿掉日期限制 > 秒殺,  結果跑出 47 筆資料

跑一下執行計畫 原來子查詢的 Ad_Trace 沒有建立Index造成


加上 Index 之後,再跑第一支SQL --> 秒殺

奇怪的地方:
明明訂單日期欄位(Create_Date) 跟 Ad_Trace 沒有多大關係,但是加上日期限制之後,居然會引發 Ad_Trace 搜尋過久的現象
他好像是先依照訂單日期找出所有訂單,然後再從子查詢 Ad_Trace 裡面搜尋有無符合的條件訂單
而不是先跑子查詢找出 Ad_Trace 所有的 Order_Id,再去找符合 Create_Date 的訂單

SQL內部運作的機制真是有點讓人想不透,幸好有評估計畫可以看出問題在哪裡
這讓我想起以前學SQL時的一句話 => 盡量用Join來取代子查詢
使用子查詢真的是效能殺手啊

------繼續補充--------------------------------------

上面的SQL在雙11活動後,由於當日訂單過多,一樣造成SQL timeout 的現象,研判還是子查詢造成的問題
Select Id, (IsNull(Total, 0) - IsNull(CouponDiscount, 0) + IsNull(CouponAdd, 0)) as Total, Buyer_Email, EN_Packing_List_Status, EN_Order_Source, En_Stock_Status, Create_Date
From V_Order_main With(Nolock)
Where Id in (select Order_Id from Ad_Trace With(NoLock) where (Parameter_Id = 14720))
And Create_Date > '2014-11-10' And Create_Date < '2014-11-11'

--> 跑了51秒

所以先將子查詢拿出來跑出一串字串 
865828,865890,865901,865903,865928,865955,865990,865993,866005,866035.....
(共1452筆)
再把他拼入sql跑   --> 7秒

 
More...
darren, 2014/10/11 上午 09:58:18
讓 IE6-8 認識 CSS 的 Media Query
使用CSS Media Query可以實現響應式網頁設計(Responsive Web Design)
但是在眾多瀏覽器中唯有IE這個萬惡瀏覽器到 IE9 及之後的版本才支援 CSS Media Query,不過有辦法可以讓 IE6 到 IE8 支援 Media Query 語法,那就是 Respond.js。

要注意的地方是:respond.js要放在css下面(順序有關係)
例:

<link rel="stylesheet" type="text/css" href="style.css" media="screen" />

<script type="text/javascript" src="js/respond.min.js"></script>


Demo

下載地址:Respond.js
 
More...
nelson, 2014/9/26 上午 11:25:45
SQL DB User 刪不掉 Error: 15138
SELECT s.name
FROM sys.schemas s
WHERE s.principal_id = USER_ID('YourUserID');

ALTER AUTHORIZATION ON SCHEMA::YourSchemaName TO dbo;


參考:http://blog.sqlauthority.com/2011/12/26/sql-server-fix-error-15138-the-database-principal-owns-a-schema-in-the-database-and-cannot-be-dropped/
More...
Reiko, 2014/9/23 下午 04:34:33
Cached DataTable 要注意的地方

網站開發,善用 Cached DataTable 可以使網站效能倍增,不必一直去資料庫抓資料。
但是使用 Cached DataTable 有一個地方要注意
就是他是 Shared 物件,表示同時有好幾個頁面都可以存取他

例如A網頁將資料抓出,然後變更裡面的DataRow資料,
另一個B網頁也會跟著變更

由於 Cached DataTable 在 Set DataRow Value 時
可能 Critical Section 沒有處理好,若真的同時多個thread 操作
會出現 Exception
(System.ArgumentOutOfRangeException: 索引超出範圍。必須為非負數且小於集合的大小。)

建議:

  • Cached DataTable 最好是只能用來讀,不要Set Value
  • 若需要Set Value,可以使用 DataTable Copy()功能,先複製出來再操作,就不會影響到原始資料

            '這是 UNT FixPage 物件抓取單一資料的範例
            Shared Function GetSpecialPage2FromCachedDT(ByVal Key As Int32) As DB.SpecialPage2
                Dim DT As DataTable = GetAllDataFromBaseTableWithCache()
                Dim Row As DataRow = DT.Rows.Find(Key)
                If Row IsNot Nothing Then
                    '避免每個thread都共用table 寫入資料會出現問題
                    Dim newDT As DataTable = DT.Clone()
                    newDT.ImportRow(Row)
                    Return New SpecialPage2(newDT.Rows(0))
                Else
                    Return Nothing
                End If
            End Function

More...
darren, 2014/9/23 下午 03:34:21
.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
|< …15161718192021222324… >|
頁數 24 / 39 上一頁 下一頁
~ Uwinfo ~