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
標籤
  • AD
  • UwQOHbcP
  • 字串
  • GUI
  • Cache Depe
  • ddd
  • IIS
  • pG2rL0AN
  • ef
  • datarow so
  • async
  • 0x71786b6b
  • 414
  • primary
  • 中文
  • UW
  • DNS
  • identity
  • 泛型錯誤
  • bike
  • Find
  • expression
  • attr
  • 150
  • 17
  • for
  • pg ORDER B
  • MaxWorkIte
  • SQL Availa
  • [t]
  • 60.5CtEp
  • dataroot
  • a
  • DTToExcelA
  • ARR
  • Rf
  • [t],
  • Findindex
  • 1
  • JQ
  • CKED
  • MSkvKiovQW
  • ti
  • 88 order b
  • Content-Di
  • prop
  • windows
  • C
  • mssql
  • 202
頁數 4 / 5 上一頁 下一頁
搜尋 100 結果:
SQL 查詢日期轉換成星期幾 改善效率的方法
一開始我用的是先傳 : CONVERT(varchar(10), Create_Date, 111) 的結果到VB 
後還Bike 教我可在SQL就先轉成 "weekday" : Datepart(dw,Create_Date) 但是效率還是有點慢
後來發現加在一起可以變更快 : Datepart(dw,CONVERT(varchar(10), Create_Date, 111))
可能是因為先變成比較好判斷的長度  實驗幾次後真的會比較快一點 
varchar(10)  可以取到需要的位數就好 varchar(10)  似乎會比 varchar(100) 再快一點 雖然測試機差異不大
More...
sean, 2014/4/16 下午 05:51:03
Visual Studio 2013 的新功能 "查看定義"
最近使用 VS2013 發現一個新功能 "查看定義" ,可以讓你不用切換主編輯視窗就可以編輯功能的內容,很好用哦。

 
More...
Bike, 2014/2/24 上午 10:08:28
尋找 Aspnet_regsql.exe 的正確版本

參考網址:http://msdn.microsoft.com/zh-tw/library/ms229862(v=vs.100).aspx#findingthecorrectversion

Aspnet_regsql.exe 安裝在 Microsoft .NET Framework 目錄中。 如果電腦正在並存執行多個 .NET Framework 版本,就可能會安裝此工具的多個版本。 下表將針對不同的 .NET Framework 版本列出此工具的安裝位置。

 

.NET Framework 的版本

Aspnet_regsql.exe 檔案的位置

.NET Framework 2.0 版、3.0 版和 3.5 版 (32 位元系統)

%windir%\Microsoft.NET\Framework\v2.0.50727

.NET Framework 2.0 版、3.0 版和 3.5 版 (64 位元系統)

%windir%\Microsoft.NET\Framework64\v2.0.50727

.NET Framework 4 版 (32 位元系統)

%windir%\Microsoft.NET\Framework\v4.0.30319

.NET Framework 4 版 (64 位元系統)

%windir%\Microsoft.NET\Framework64\v4.0.30319

More...
Doug, 2014/2/10 下午 12:20:20
IndexOf 效能問題
一直覺得 UW.Template 應該還有改善的空間,因為網站大量使用這個物件
只要有一些些效能調教,對於整體效能應該有很大的幫助

昨天發現切版的程式 UW.Template => GetTemplateFromString
在使用 IndexOf 去尋找 <!--Key S--> 及 <!--Key E--> 時,
<!--Key E--> 可能有一些問題,因為他是從第0個位置開始找
而實際上他應該是從 <!--Key S--> 後面開始找比較對
所以後者的 IndexOf 要加個 StartIndex 參數值比較對


    StartP = StartP + StartKey.Length
    Dim EndP As String = Source.IndexOf(EndKey, StringComparison.OrdinalIgnoreCase)
    ' 應該修改為以下寫法 =>
    StartP = StartP + StartKey.Length
    Dim EndP As String = Source.IndexOf(EndKey, StartP, StringComparison.OrdinalIgnoreCase)    


另外 我也針對 StringComparison 做一些測試 
然後以一個 20KB 的 html 去抓出 <!--Content E--> 的位置
測試結果如下 (StartP 是 <!--Content S--> 後的起始位置)


0.0005085 No StartP
0.0002082 with StartP
0.0000157 StringComparison.Ordinal with StartP
0.0002768 StringComparison.OrdinalIgnoreCase, No StartP
0.0001105 StringComparison.OrdinalIgnoreCase with StartP
0.0002116 StringComparison.CurrentCulture with StartP
0.0002085 StringComparison.CurrentCultureIgnoreCase with StartP


結論: 
1. IndexOf 預設是以 StringComparison.CurrentCulture 方式尋找字串
2. 對於大塊字串,請盡量用 StartP 去找結束標籤位置,這樣速度會快很多,因為少爬了一段文字,此範例是差了2.5倍
3. 對於大塊字串,除非大小寫都要找,不然盡量用 StringComparison.Ordinal 來尋找字串,速度差了7~8倍

微軟對於.NET字串處理 有一篇建議文章,請大家拜讀一下
http://msdn.microsoft.com/zh-tw/library/vstudio/dd465121(v=vs.100).aspx
More...
darren, 2014/1/14 下午 03:18:14
SQL 2008 內建備份功指定到網路磁碟機
不同主機,windows登入帳號不同時,需先指定帳密才可備份。

-- To allow advanced options to be changed.開啟進階選項
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.執行動作
RECONFIGURE
GO
-- To enable the feature.開啟xp_cmdshell功能
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.執行動作
RECONFIGURE
GO


DECLARE @DBPath nvarchar(120)
--指定磁碟機Z的路徑為\\192.168.8.201\SQLBackupLeon
exec master..xp_cmdshell 'net use z: \\192.168.8.201\SQLBackupLeon 密碼 /user:帳號'
--指定備份路徑檔名
SET @DBPath = 'Z:\' + 'ReikoTEST' + '_' + Convert(varchar(10),Getdate(),112) + Replace(Convert(varchar(8),Getdate(),108),':','') + '.bak'
--DATENAME(Weekday,GETDATE())=>會顯示為"星期N"
--SET @DBPath = 'Z:\' + 'Leon' + '_' + DATENAME(Weekday,GETDATE()) + '.bak'
--備份資料庫ReikoTEST到路徑檔名
BACKUP DATABASE ReikoTEST TO DISK = @DBPath
--刪除磁碟機Z
exec master..xp_cmdshell 'net use Z: /delete'
GO


-- To enable the feature.關閉xp_cmdshell功能
EXEC sp_configure 'xp_cmdshell', 0
GO
-- To update the currently configured value for this feature.執行動作
RECONFIGURE
GO
-- To allow advanced options to be changed.關閉進階選項
EXEC sp_configure 'show advanced options', 0
GO
-- To update the currently configured value for advanced options.執行動作
RECONFIGURE
GO


※ xp_cmdshell不要常開著,有風險,用完要關掉。
※ 網路磁碟機路徑要開啟安全性設定,設定為:\\[IP]\[資料夾],不可用\\[IP]\D$\[資料夾]
※ net use 指定資料夾後方,不可加 \
參考資料:http://ithelp.ithome.com.tw/question/10086406
More...
Reiko, 2013/12/12 上午 10:36:00
修改環境變數 "Path"
參考下圖:

 
 
More...
Bike, 2013/12/3 上午 11:11:14
ASPJPEG on 64bit IIS
啟用 32 位元應用程式要設為 False。

More...
Bike, 2013/10/3 下午 02:44:25
在 window load 之後使用 setTimeout 可以加速網頁的例子
下面的圖片可以注意 GetStopSellProducts.aspx 的執行位置。

原來的做法,在 window.load 時就執行一段 longcode,window.load 的時間約在 736 ms: 
$(window).load(function () {
    UpdateQty();
});




用 setTimeout 去呼叫 UpdateQty 大概可以省下 200 ms,只要 507 ms 就可以完成 window.load,如下圖。
$(window).load(function () {
    window.setTimeout("UpdateQty();", 100);    
});

 
 
More...
Bike, 2013/5/19 下午 05:32:36
MRTG 監控系統設定
查了監控 snmp 的套件,還是 mrtg 最簡單,做個紀錄一下

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
先安裝 windows server snmp 服務,啟動​並進行設定

可參考:http://blog.faq-book.com/?p=1799
設定 public 的地方需輸入,會與 mrtg 的設定有關

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
安裝 ActivePerl,並下載解壓 mrtg 到任意目錄
官網:http://mrtg.cs.pu.edu.tw/download.en.html

這裏以 c:\mrtg 為例

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
設定 c:\mrtg\bin\127.0.0.1.cfg, 並執行 c:\mrtg\bin\perl mrtg 127.0.0.1.cfg 可跑一次
會產生 html&圖 到 WorkDir: 下,再設成 iis web 即可

c:\mrtg\bin\127.0.0.1.cfg 範例
#設為背景服務
RunAsDaemon: no

#統計間隔(預設5分鐘 Interval:5)
Interval:5

#網頁訊息中文顯示
Language: big5

#瀏覽器重新讀取間隔(預設Refresh:300秒)
Refresh:300
WorkDir: c:\inetpub\wwwroot\mrtg
EnableIPv6: no

########################################################
# 127.0.0.1 CPU Loading
########################################################
Target[127.0.0.1-cpu]: .1.3.6.1.2.1.25.3.3.1.2.1&.1.3.6.1.2.1.25.3.3.1.2.2:public@127.0.0.1
Title[127.0.0.1-cpu]: CPU Loading
PageTop[127.0.0.1-cpu]: </code><h1>CPU Loading - 127.0.0.1</h1>
Colours[127.0.0.1-cpu]: R#ff4f27,Y#FFFF00,,R#ff4f27,Y#FFFF00
MaxBytes[127.0.0.1-cpu]: 100
Options[127.0.0.1-cpu]: gauge, nopercent, growright
Directory[127.0.0.1-cpu]: 127.0.0.1
YLegend[127.0.0.1-cpu]: CPU loading (%)
ShortLegend[127.0.0.1-cpu]: %
Legend1[127.0.0.1-cpu]: CPU1 負載
Legend2[127.0.0.1-cpu]: CPU2 負載
LegendI[127.0.0.1-cpu]: CPU1 負載
LegendO[127.0.0.1-cpu]: CPU2 負載


[127.0.0.1-cpu] 為產生檔名
Directory[127.0.0.1-cpu]: 127.0.0.1 會建立 127.0.0.1 的目錄來放 html&圖

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
建立 bat 排程每五分跑一次即可

mrtg.bat
perl mrtg 192.168.0.10.cfg
perl mrtg 192.168.0.20.cfg

rem 幫你建立 index.html
perl indexmaker --output c:\inetpub\wwwroot\mrtg\index.html 192.168.0.10.cfg 192.168.0.20.cfg


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
較麻煩的是 Target 的設定,為 snmp 的節點值,跟效能監視器裏的項目有點像

查到的較有用的
CPU Loading
Target[127.0.0.1-cpu]: .1.3.6.1.2.1.25.3.3.1.2.1&.1.3.6.1.2.1.25.3.3.1.2.2:public@127.0.0.1
其中 .1.3.6.1.2.1.25.3.3.1.2 固定,.1 .2 隨不同機器的 cpu 數 .3 .4 都有可能

Current Connections
Target[192.168.0.10-webusers]: .1.3.6.1.4.1.311.1.7.3.1.13.0&.1.3.6.1.4.1.311.1.7.3.1.14.0:public@127.0.0.1

Network Usage
Target[192.168.0.10-network]: \Realtek\ PCIe\ GBE\ Family\ Controller:public@127.0.0.1
這裏都會跟網卡名綁,通常用執行
perl cfgmaker --global "WorkDir: c:\inetpub\wwwroot\mrtg" --ifref=descr --ifdesc=descr public@127.0.0.1 --output network.cfg
它會幫你跑一遍路的節點,再挑出來用即可

Cpu 溫度找不到內建通用的,要安裝第三方套件,開其它篇寫

查到最完整的第三方提供 snmp 統整節點,但要錢,免費版節點很少,也沒有溫度

http://www.snmp-informant.com/
http://www.snmp-informant.com/products/std/snmp-informant-std-tree.htm 免費版節點

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
結果圖








 
More...
Jerry, 2013/4/13 下午 03:18:47
查看資料庫最耗時的Sql Command
從網路找到改良的,直接查不用開Sql Profiler

加入可指定資料庫的改良
SELECT TOP 100 execution_count, total_worker_time, last_worker_time, max_worker_time, min_worker_time, CONVERT(INT, att.value) AS dbid, DB_NAME(CONVERT(INT, att.value)) as dbname ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,((CASE statement_end_offset WHEN -1 THEN DATALENGTH(st.text)ELSE qs.statement_end_offset END - qs.statement_start_offset)/2) + 1) as statement_text
FROM sys.dm_exec_query_stats as qs 
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
CROSS APPLY sys.dm_exec_plan_attributes(qs.plan_handle) att
WHERE att.attribute='dbid' and DB_NAME(CONVERT(INT, att.value)) = 'P9'
ORDER BY execution_count DESC 


以執行次數排序,可檢查爆量的Sql
Where statement_start_offset =0 測起來可以篩掉系統的Query,如:AspNet_SqlCache
SELECT TOP 10 execution_count, total_worker_time, last_worker_time, max_worker_time, min_worker_time, SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,((CASE statement_end_offset WHEN -1 THEN DATALENGTH(st.text)ELSE qs.statement_end_offset END - qs.statement_start_offset)/2) + 1) as statement_text
FROM sys.dm_exec_query_stats as qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
WHERE statement_start_offset = 0
ORDER BY execution_count DESC  


以總執行時間排序,檢查寫耗時的Sql
SELECT TOP 10 total_worker_time, last_worker_time, max_worker_time, min_worker_time, SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,((CASE statement_end_offset WHEN -1 THEN DATALENGTH(st.text)ELSE qs.statement_end_offset END - qs.statement_start_offset)/2) + 1) as statement_text
FROM sys.dm_exec_query_stats as qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
ORDER BY max_worker_time DESC


結果如下


 
More...
Jerry, 2012/6/8 下午 12:50:24
|< 12345 >|
頁數 4 / 5 上一頁 下一頁
~ Uwinfo ~