2014年8月27日 星期三

下拉式選單 Select


<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
    <td bgcolor="#CAF2FF" width="20%" class="font" align="center">匯入年份</td>
        <td bgcolor="#FFFFFF" width="80%" class="font" align="left">
        <Select Name='sel_year'>
            <option value="" selected>---請選擇---</option>
<%
        For i=year(date) to year(date)+1
%>
<Option Value="<%=i%>"><%=i%></Option>
            <%
Next
%></Select>
           
        </td>
</tr>

2014年8月18日 星期一

sql injection






<%
Response.ExpiresAbsolute = Now() - 1
Response.Buffer = True
Response.Expires = 0
Response.cacheControl="no cache"
Function FRequest(ByVal ChkStr) 

Dim Str 
Str = Trim(Request(ChkStr)) 

If IsNull(Str) Then 
FRequest = "" 
Exit Function 
End If 

Dim re 
Set re = new RegExp 
re.IgnoreCase = True 
re.Global = True 
re.Pattern = "(\r\n){3,}" 
Str = re.Replace(Str,"$1$1$1") 
Set re = Nothing 

Str = Replace(Str,"'","''") 
Str = Replace(Str, "--", "&#45;&#45;")    
Str = Replace(Str, "/*", "&#47;&#42;")    
Str = Replace(Str, "*/", "&#42;&#47;")    
Str = Replace(Str, "select", "sel&#101;ct") 
Str = Replace(Str, "join", "jo&#105;n") 
Str = Replace(Str, "union", "un&#105;on") 
Str = Replace(Str, "where", "wh&#101;re") 
Str = Replace(Str, "insert", "ins&#101;rt") 
Str = Replace(Str, "delete", "del&#101;te") 
Str = Replace(Str, "update", "up&#100;ate") 
Str = Replace(Str, "like", "lik&#101;") 
Str = Replace(Str, "drop", "dro&#112;") 
Str = Replace(Str, "create", "cr&#101;ate") 
Str = Replace(Str, "modify", "mod&#105;fy") 
Str = Replace(Str, "rename", "ren&#097;me") 
Str = Replace(Str, "alter", "alt&#101;r") 
Str = Replace(Str, "cast", "ca&#115;t") 
Str = Replace(Str, "ASPSESSIONIDCCDDTASQ", "") 
Str = Replace(Str, "ASPSESSIONIDCACATBSQ", "") 
FRequest = Str 

End Function
on error resume next
%>
<!-- #include file="../admin/setting/conn.asp"-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="zh-TW">
<head>




程式 : cat, pda ,timesheet01.asp

2014年8月14日 星期四

檔案複製 錯誤 '800a0046' 沒有使用權限





Set fs=Server.CreateObject("Scripting.FileSystemObject")
fs.CopyFile Src_fName,Des_fPath & "\"



Microsoft VBScript 執行階段錯誤 錯誤 '800a0046'

沒有使用權限

/admin/big5/fun/gen/trans.asp, 列53


使用 On filesystemobject的 .filecopy 方法,得到以下錯誤訊息,應該如何處理? 
Microsoft VBScript runtime error '800a0046' 
Permission denied 

答: 請確定最後的參數有包含一個反斜線(backslash) ,說明如下 
是 "c:\temp\" 
而不是 c:\temp" 

參考
http://big5.webasp.net/article/13/12027.htm




遇到另一個狀況,也是出現同樣的錯誤訊息。

狀況 : 有修改過windows使用者密碼

重開機之後就正常了。


檔案名稱太複雜也不允許,例:RR-ENR-2.1-en-TW.pdf 。