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
標籤
  • profiler
  • 1
  • sp_
  • sa
  • ssL
  • c
  • weget
  • 6903
  • 1421211211
  • SQL
  • 232
  • MSB1009
  • 36
  • 1595
  • AD
  • a
  • if
  • SU
  • big5 order
  • 0
  • 600
  • 88
  • entity
  • -2313
  • .
  • asp
  • 98
  • WU
  • 22
  • 分段
  • -2645
  • config,
  • 706
  • [u2]
  • cookie
  • vs
  • 6402-6385
  • 旋
  • ?
  • canvas
  • tim
  • ef
  • U2
  • aspx
  • 1489
  • 728
  • darren
  • 圖片
  • 3175
  • 92
頁數 13 / 40 上一頁 下一頁
搜尋 1 結果:
把 yyyymmdd 轉換成 yyyy-mm-dd 的神奇 javascript
試試這個:
"20190101".replace(/(\d{4})(\d{2})(\d{2})/g, '$1-$2-$3')

取得 yyyyMMdd 的方法
var D = new Date();
D.toISOString().slice(0,10).replace(/-/g,"");
More...
Bike, 2019/8/21 下午 04:47:55
上傳圖片 直的變成橫的的問題
https://stackoverflow.com/questions/17186568/upload-from-ios-picture-to-net-app-rotate

 讀取某個參數來判斷            if (image_file.PropertyIdList.Contains(0x0112))
            {
                int rotationValue = image_file.GetPropertyItem(0x0112).Value[0];
                switch (rotationValue)
                {
                    case 1: // landscape, do nothing
                        break;

                    case 8: // rotated 90 right
                            // de-rotate:
                        image_file.RotateFlip(rotateFlipType: RotateFlipType.Rotate270FlipNone);
                        break;

                    case 3: // bottoms up
                        image_file.RotateFlip(rotateFlipType: RotateFlipType.Rotate180FlipNone);
                        break;

                    case 6: // rotated 90 left
                        image_file.RotateFlip(rotateFlipType: RotateFlipType.Rotate90FlipNone);

                        image_file.Save(Path + FileName);
                        break;
                }
            }
More...
sean, 2019/8/19 下午 06:11:28
Application_PreSendRequestContent 會影響到 Application_Error 的輸出
在  Global.asax 中, 定義了 Application_PreSendRequestContent 的話, 會影響到 Application_Error 的輸出, 即始 Application_PreSendRequestContent 是空的: 感覺像是 Application_Error 失效



 


若是沒有 Application_PreSendRequestContent 的情況下. 結果如下圖:

  


 
More...
Bike, 2019/8/16 下午 05:05:45
SQL恢復[正在還原]資料庫
https://dotblogs.com.tw/jerrywang0109/2017/04/16/164223

SQL恢復[正在還原]資料庫


-- 切換資料庫的狀態為:ONLINE。

RESTORE DATABASE [資料庫名稱]
WITH RECOVERY
GO
More...
sean, 2019/7/24 下午 05:02:39
No EditorOptionDefinition Export Found Error
VS 2013 發生的錯誤

https://stackoverflow.com/questions/23893497/no-editoroptiondefinition-export-found-error

1. Close Visual Studio
2. Open the folder: %LocalAppData%\Microsoft\VisualStudio\12.0\ (in C:\users\'%userName%'\AppData\Local\Microsoft\VisualStudio\12.0\)
3. Rename the ComponentModelCache folder
4. Restart Visual Studio.

 
More...
sean, 2019/7/19 上午 09:59:06
[錯誤訊息] 請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)
錯誤訊息:
WebForms UnobtrusiveValidationMode 需要 'jquery' 的 ScriptResourceMapping。請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)。

解決方式:
在有用 validation 那頁的 Page_Load 加上,就恢復正常了
protected void Page_Load(object sender, EventArgs e)
{
     UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
}

參考來源:
https://blog.xuite.net/tolarku/blog/63451508-VS+2012+%E5%88%9D%E9%AB%94%E9%A9%97+-+%E9%9C%80%E8%A6%81+%27jquery%27+%E7%9A%84+ScriptResourceMapping+%E9%8C%AF%E8%AA%A4
https://www.c-sharpcorner.com/UploadFile/cd7c2e/enabling-unobtrusive-validation-mode-in-Asp-Net-4-5/
More...
choco, 2019/7/9 上午 09:37:20
ASP.NET 的執行帳號 (在加入 AD 的主機下) IIS7.5, windows 2012 之後版本
在加入 AD 的主機下, ASP.NET 執行的預設帳號是本機帳號的 IIS_IUSERS 哦.

More...
Bike, 2019/7/7 上午 12:23:45
IIS 7.0 ClientIP() 會抓到 IPv6 而非 IPv4
IIS 7.0 之後 
用 HttpContext.Current.Request.UserHostAddress 抓的IP會是 
類似 fe80::b148:cddc:81cd:fd10%2 
這樣的IPv6 位址
如果要抓 IPv4 要特別改寫

參考
https://dotblogs.com.tw/hunterpo/2011/03/21/21991


HttpContext.Current.Request.UserHostAddress


暫時的替代方法
public static string GetClientIPv4() { string ipv4 = String.Empty; foreach (IPAddress ip in Dns.GetHostAddresses(GetClientIP())) { if (ip.AddressFamily.ToString() == "InterNetwork") { ipv4 = ip.ToString(); break; } } if (ipv4 != String.Empty) { return ipv4; } // 原作使用 Dns.GetHostName 方法取回的是 Server 端資訊,非 Client 端。 // 改寫為利用 Dns.GetHostEntry 方法,由獲取的 IPv6 位址反查 DNS 紀錄, // 再逐一判斷何者屬 IPv4 協定,即可轉為 IPv4 位址。 foreach (IPAddress ip in Dns.GetHostEntry(GetClientIP()).AddressList) //foreach (IPAddress ip in Dns.GetHostAddresses(Dns.GetHostName())) { if (ip.AddressFamily.ToString() == "InterNetwork") { ipv4 = ip.ToString(); break; } } return ipv4; } /// <summary> /// 取得客戶端主機位址 /// </summary> public static string GetClientIP() { if (null == HttpContext.Current.Request.ServerVariables["HTTP_VIA"]) { return HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } else { return HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; } }
More...
sean, 2019/6/27 下午 06:47:31
SQL需要定期索引重建或重組
今天發生一個SQL奇怪的現象,記錄一下
就是訂單列表(使用分頁的SQL 找出 top 20)跑很久才出來,大約10多秒 
SQL指令條件僅有訂單日期(預設是1年內訂單,訂單總數有130萬筆),而訂單日期也有做index
之前都大約1~2秒就出來,這一兩天卻要10秒才跑出來

用執行計畫評估功能查也看不出哪裡有問題,把一些子查詢拿掉也沒有改善
所以就改一下搜尋條件,改搜尋半年內訂單,大約 5秒
改搜尋兩年內訂單,1秒!!! 真是神奇,把條件區間拉大反而很快???????
直覺上覺得索引table是不是太大太亂了,剛好看到CreateDate索引有個重建按鈕
就勇敢把他按下去,想說會不會跑很久,結果重建只要不到1秒就好了
然後神奇的事發生了,訂單列表不須一秒就顯示出來啦!

SQL 指令大概長這樣
Select * from (
Select Top 20 * from (
select Top 20 a.*
--, CompelteOrderId= (select top 1 K.Id from packing_list_main k With(NoLock) join Order_Main p With(NoLock) on k.Order_Id=p.Id where k.En_Packing_List_Status=300 and P.MEmber_Id=a.Member_Id )
--, [MemoCount_前台問題] = (Select COUNT(*) from Order_Memo With(NoLock) where Order_Memo.Order_Id = a.Id and Memo_Type = 1)
--, [MemoCount_業務備註] = (Select COUNT(*) from Order_Memo With(NoLock) where Order_Memo.Order_Id = a.Id and Memo_Type = 3)
--, [MemoCount_系統檢查] = (Select COUNT(*) from Order_Memo With(NoLock) where Order_Memo.Order_Id = a.Id and Memo_Type = 4)
--, QnACount = (select count(*) from Order_QnA With(NoLock) where Order_Id = a.Id)
from V_Order_Main_For_Admin_List a With(NoLock) left join Member b with(NoLock) on a.Member_Id=b.Id where (1=1) and En_Order_Status <> -300 and a.Create_Date >='2018-06-20' order by Id Desc
) AS T1 order by Id
) AS T2 order by Id Desc


參考 will will web 的舊文章,原來定期把索引整理整理,也是要記得做的。
不過週期上我想 1季或半年跑一次應該就可以了
-------------------------------------------------------------------
後記: 2020/6/22 -  一年後又發生一樣的狀況,真是神奇
這次 OrderMain CreateDate 沒有很分散。只有 2.X %
想說其他 index 是不是該重建,但是都沒有效果
最後只好重建 CreateDate --> 結果居然解決了

看 2021年會在發生嗎?

 
More...
darren, 2019/6/21 上午 12:05:00
資安的檢測
先寫幾個, 有空再整理.

1. Upload Folder 的執行權限要關閉
2. 在HTTP Header加入X-Frame-Options: DENY或SAMEORIGIN。
3. web.config 的 connection string 和 app setting 要加密
More...
Bike, 2019/6/19 下午 05:53:18
|< …45678910111213… >|
頁數 13 / 40 上一頁 下一頁
~ Uwinfo ~