2014年7月15日 星期二

[.NET ASP] 根治錯誤

from : http://blog.csdn.net/nileel/article/details/3519744


編譯完項目,訪問,經常出現“配置錯誤”,行***<add assembly="*"/>,某“DLL”文件拒绝访问。重启IIS也不行,重新编译也不对,基本每天都能遇到,频繁的时候编译一次遇到一次。狠狠的百度了一番,终于明白了。原来是windows的索引服务在搞鬼。windows的索引服务对asp.net的临时目录编制索引时,锁定了临时文件的访问权限,因此报错!
知道了原因,就好辦了

最簡單的解決辦法就是禁用索引服務,但是影響比較大。
可以刪除的PDB文件,但是調試的時候不方便
最後我採用的解決辦法是:
配置ASP.net的臨時目錄不受索引服務服務的影響的步驟如下:

1,開始 - 管理工具 - 計算機管理(Win2003的的位置,其他操作系統類似)打開計算機管理
2、展开计算机管理左边树中“服务和应用程序”节点,再在其下展开“索引服务”节点,再在其下展开“System”节点,再在其下展开“目录”节点。
3,在計算機管理的右邊我們可以看到配置的索引服務目錄。
4,在“目錄”節點上右擊鼠標,選擇“新建” - “目錄”
5,在“添加目錄”對話框中,路經輸入框中輸入ASP.net的臨時文件目錄默認應該是:
C :/ WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files文件/
6,在“包含在索引中嗎?”選項中,選擇“否”
7,單擊“確定”按鈕
8,在“索引服務”節點上右鍵單擊,重起索引服務即可。



















2014年7月7日 星期一

[C#] 如何取得 Request URL 的各個部分


from寶哥  http://blog.miniasp.com/post/2008/02/10/How-Do-I-Get-Paths-and-URL-fragments-from-the-HttpRequest-object.aspx


底下這張表就是各種跟 Browser Request 的網址相關的屬性與用法:


網址:http://localhost:1897/News/Press/Content.aspx/123?id=1#toc
Request.ApplicationPath/
Request.PhysicalPathD:\Projects\Solution\web\News\Press\Content.aspx
System.IO.Path.GetDirectoryName(Request.PhysicalPath)D:\Projects\Solution\web\News\Press
Request.PhysicalApplicationPathD:\Projects\Solution\web\
System.IO.Path.GetFileName(Request.PhysicalPath)Content.aspx
Request.CurrentExecutionFilePath/News/Press/Content.aspx
Request.FilePath/News/Press/Content.aspx
Request.Path/News/Press/Content.aspx/123
Request.RawUrl/News/Press/Content.aspx/123?id=1
Request.Url.AbsolutePath/News/Press/Content.aspx/123
Request.Url.AbsoluteUrihttp://localhost:1897/News/Press/Content.aspx/123?id=1
Request.Url.Schemehttp
Request.Url.Hostlocalhost
Request.Url.Port1897
Request.Url.Authoritylocalhost:1897
Request.Url.LocalPath/News/Press/Content.aspx/123
Request.PathInfo/123
Request.Url.PathAndQuery/News/Press/Content.aspx/123?id=1
Request.Url.Query?id=1
Request.Url.Fragment 
Request.Url.Segments/
News/
Press/
Content.aspx/
123






[SQL] NOT IN clause and NULL values


from:http://stackoverflow.com/questions/129077/not-in-clause-and-null-values


當下NOT IN時,括號裡面的值含有NULL,就會甚麼都撈不到

因為null不等於任何值

null也不等於null

所以,下NOT IN時,建議將null過濾掉 WHERE *** IS NOT NULL


A: select 'true' where 3 in (1, 2, 3, null)
B: select 'true' where 3 not in (1, 2, null)


Query A is the same as:
select 'true' where 3 = 1 or 3 = 2 or 3 = 3 or 3 = null
Since 3 = 3 is true, you get a result.
Query B is the same as:
select 'true' where 3 <> 1 and 3 <> 2 and 3 <> null
When ansi_nulls is on, 3 <> null is UNKNOWN, so the predicate evaluates to UNKNOWN, and you don't get any rows.
When ansi_nulls is off, 3 <> null is true, so the predicate evaluates to true, and you get a row.
zh-CN → zh-TW
,下

2014年7月6日 星期日

[C#] KeyValue 代碼表

from: http://www.cnblogs.com/manongxiaobing/archive/2012/11/05/2755412.html



  鍵盤按鍵 - 對應的代碼
backspace8
tab9
enter13
shift16
ctrl17
alt18
pause/break19
caps lock20
escape27
page up33
Space32
page down34
end35
home36
arrow left37
arrow up38
arrow right39
arrow down40
insert45
delete46
048
149
250
351
452
553
654
755
856
957
a65
b66
c67
d68
e69
f70
g71
h72
i73
j74
k75
l76
m77
n78
o79
p80
q81
r82
s83
t84
u85
v86
w87
x88
y89
z90
left window key91
right window key92
select key93
numpad 096
numpad 197
numpad 298
numpad 399
numpad 4100
numpad 5101
numpad 6102
numpad 7103
numpad 8104
numpad 9105
multiply106
add107
subtract109
decimal point110
divide111
f1112
f2113
f3114
f4115
f5116
f6117
f7118
f8119
f9120
f10121
f1










 

MangoHost Copyright © 2009 Cookiez is Designed by Ipietoon for Free Blogger Template