標籤:style blog http color io os 使用 ar for
1. 使用SQL統計一個字串中指定字元的個數,樣本(統計0的個數):
select len(‘402301001‘) - len(replace(‘402301001‘,‘0‘,‘‘))
2. 使用Forms認證,用戶端本地時間不對無法登陸系統,解決辦法:
FormsAuthentication.RedirectFromLoginPage第二個參數設定成false,MSDN資料:http://msdn.microsoft.com/zh-cn/library/ka5ffkce(v=vs.110).aspx
3. 網站伺服器CPU100%,找到具體是IIS中那個網站導致的:
①首先設定工作管理員的查看方式,加入PID的顯示;
②用C:\Windows\System32\inetsrv>appcmd list wp命令定位到具體網站PID(此處為Server 2008裡的命令,Server 2003是 iisapp -a 命令);
4. jQuery1.6中attr("checked")無效,正確寫法:
三種寫法:if ( elem.checked )或if ( $( elem ).prop( "checked" ) )或if ( $( elem ).is( ":checked" ) )
官方文檔:http://api.jquery.com/attr/
5. n多log4net的記錄檔,只能藉助editplus尋找。解決辦法:用Log Parser Lizard 或者SQL SERVER 中寫查詢
6. 網站提示訪問IIS中繼資料庫失敗,解決辦法(命令):aspnet_regiis -ga ASPNET
7. 遠端桌面關閉了Explorer進程,怎麼開啟遠端桌面的工作管理員: Ctrl+Shift+Esc
8. .NET2.0版序列化DataSet序列化為json,json還原序列化為DataSet:http://json.codeplex.com/
9. 將EXCEL資料快速產生組織圖:http://www.visio123.com/Visio_2010/Visiokuachengxushiyong/20130225/33.html
10. web.config上傳檔案大小設定(Windows Server 2008與以前的Windows Server 2003設定不一樣):
Windows Server 2003中web.config配置為在system.web節點下添加如下配置:
<!--100MB--><httpRuntime maxRequestLength="102400" useFullyQualifiedRedirectUrl="true" />
Windows Server 2008中web.config還得在system.webServer節點下添加如下配置:
<security> <requestFiltering> <requestLimits maxAllowedContentLength="102400000" /> </requestFiltering></security>
具體設定方法,參考:http://www.cnblogs.com/henryhappier/archive/2010/09/20/1832098.html。實際測試中發現配置成102400000傳20MB的檔案就出異常了,配置成1024000000就沒問題……
近期ASP.NET問題匯總及對應的解決辦法