① ASP.NET的一個拍賣項目。商品都有一個截拍時間,當前時間等於截拍時間時,生成一個訂單,並修改商品狀態
這個放在前端是非常不安全的啊
最好放在後端用asp.net控制
因為js的當前時間是用戶操作系統的時間吧
而且js代碼也是用戶可以任意修改的
太不安全了
② 用asp編寫網站源碼,相對於新手和其他編寫方式有什麼優缺點!
asp環境容易搭建,一個IIS和一個編寫軟體就可以搞定,對於簡單的輸出資料庫的信息和寫進資料庫去,操作起來簡單。但缺點就是一些復雜的程序用asp寫太麻煩了,邏輯關系一沒掌握好,就容易報錯。而且安全性也比較低。
php的環境搭建比較困難,新手的話,有的就算給你搭建的方法,你去搭建環境也容易出錯。優點就是編寫一些普遍的程序可以不用自己寫,網上一搜就能搜到。安全性也高一點。其實我個人感覺asp的語法跟php的差不多。
其實最大的缺點就是,asp程序員的工資比php程序員的低了好多。呵呵。
③ 圖片上傳的ASP源代碼
4個文件實現無組件上傳4個文件實現無組件上傳
嵌套式調用:
<iframe name="ad" frameborder=0 width=100% height=50 scrolling=no src=uploada.asp></iframe>
直接鏈接:uploada.asp
文件保存路徑:upload
上傳文件類型和大小自己設置
===========================================
第一個文件:inc/confing.asp(inc為文件夾名稱)
<%
Const EnableUploadFile="Yes" '是否開放文件上傳
Const MaxFileSize=200 '上傳文件大小限制
Const UpFileType="gif|jpg|bmp|png|swf|doc|txt|rar|zip" '允許的上傳文件類型
%>
===========================================
第二個文件:inc/upload.asp
dim oUpFileStream
Class upload_file
dim Form‚File‚Version
Private Sub Class_Initialize
'定義變數
dim RequestBinDate‚sStart‚bCrLf‚sInfo‚iInfoStart‚iInfoEnd‚tStream‚iStart‚oFileInfo
dim iFileSize‚sFilePath‚sFileType‚sFormvalue‚sFileName
dim iFindStart‚iFindEnd
dim iFormStart‚iFormEnd‚sFormName
'代碼開始
Version="無組件上傳類 Version 0.96"
set Form = Server.CreateObject("scripting.Dictionary")
set File = Server.CreateObject("scripting.Dictionary")
if Request.TotalBytes < 1 then Exit Sub
set tStream = Server.CreateObject("adodb.stream")
set oUpFileStream = Server.CreateObject("adodb.stream")
oUpFileStream.Type = 1
oUpFileStream.Mode = 3
oUpFileStream.Open
oUpFileStream.Write Request.BinaryRead(Request.TotalBytes)
oUpFileStream.Position=0
RequestBinDate = oUpFileStream.Read
iFormEnd = oUpFileStream.Size
bCrLf = chrB(13) & chrB(10)
'取得每個項目之間的分隔符
sStart = MidB(RequestBinDate‚1‚ InStrB(1‚RequestBinDate‚bCrLf)-1)
iStart = LenB (sStart)
iFormStart = iStart+2
'分解項目
Do
iInfoEnd = InStrB(iFormStart‚RequestBinDate‚bCrLf & bCrLf)+3
tStream.Type = 1
tStream.Mode = 3
tStream.Open
oUpFileStream.Position = iFormStart
oUpFileStream.CopyTo tStream‚iInfoEnd-iFormStart
tStream.Position = 0
tStream.Type = 2
tStream.Charset ="gb2312"
sInfo = tStream.ReadText
'取得表單項目名稱
iFormStart = InStrB(iInfoEnd‚RequestBinDate‚sStart)-1
iFindStart = InStr(22‚sInfo‚"name="""‚1)+6
iFindEnd = InStr(iFindStart‚sInfo‚""""‚1)
sFormName = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
'如果是文件
if InStr (45‚sInfo‚"filename="""‚1) > 0 then
set oFileInfo= new FileInfo
'取得文件屬性
iFindStart = InStr(iFindEnd‚sInfo‚"filename="""‚1)+10
iFindEnd = InStr(iFindStart‚sInfo‚""""‚1)
sFileName = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
oFileInfo.FileName = GetFileName(sFileName)
oFileInfo.FilePath = GetFilePath(sFileName)
oFileInfo.FileExt = GetFileExt(sFileName)
iFindStart = InStr(iFindEnd‚sInfo‚"Content-Type: "‚1)+14
iFindEnd = InStr(iFindStart‚sInfo‚vbCr)
oFileInfo.FileType = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
oFileInfo.FileStart = iInfoEnd
oFileInfo.FileSize = iFormStart -iInfoEnd -2
oFileInfo.FormName = sFormName
file.add sFormName‚oFileInfo
else
'如果是表單項目
tStream.Close
tStream.Type = 1
tStream.Mode = 3
tStream.Open
oUpFileStream.Position = iInfoEnd
oUpFileStream.CopyTo tStream‚iFormStart-iInfoEnd-2
tStream.Position = 0
tStream.Type = 2
tStream.Charset = "gb2312"
sFormvalue = tStream.ReadText
form.Add sFormName‚sFormvalue
end if
tStream.Close
iFormStart = iFormStart+iStart+2
'如果到文件尾了就退出
loop until (iFormStart+2) = iFormEnd
RequestBinDate=""
set tStream = nothing
End Sub
Private Sub Class_Terminate
'清除變數及對像
if not Request.TotalBytes<1 then
oUpFileStream.Close
set oUpFileStream =nothing
end if
Form.RemoveAll
File.RemoveAll
set Form=nothing
set File=nothing
End Sub
'取得文件路徑
Private function GetFilePath(FullPath)
If FullPath <> "" Then
GetFilePath = left(FullPath‚InStrRev(FullPath‚ "\"))
Else
GetFilePath = ""
End If
End function
'取得文件名
Private function GetFileName(FullPath)
If FullPath <> "" Then
GetFileName = mid(FullPath‚InStrRev(FullPath‚ "\")+1)
Else
GetFileName = ""
End If
End function
'取得擴展名
Private function GetFileExt(FullPath)
If FullPath <> "" Then
GetFileExt = mid(FullPath‚InStrRev(FullPath‚ ".")+1)
Else
GetFileExt = ""
End If
End function
End Class
'文件屬性類
Class FileInfo
dim FormName‚FileName‚FilePath‚FileSize‚FileType‚FileStart‚FileExt
Private Sub Class_Initialize
FileName = ""
FilePath = ""
FileSize = 0
FileStart= 0
FormName = ""
FileType = ""
FileExt = ""
End Sub
'保存文件方法
Public function SaveToFile(FullPath)
dim oFileStream‚ErrorChar‚i
SaveToFile=1
if trim(fullpath)="" or right(fullpath‚1)="/" then exit function
set oFileStream=CreateObject("Adodb.Stream")
oFileStream.Type=1
oFileStream.Mode=3
oFileStream.Open
oUpFileStream.position=FileStart
oUpFileStream.to oFileStream‚FileSize
oFileStream.SaveToFile FullPath‚2
oFileStream.Close
set oFileStream=nothing
SaveToFile=0
end function
End Class
%>
========================================
第三個文件:uploada.asp
<!--#include file="Inc/config.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
BODY{
BACKGROUND-COLOR: #f5feed;
font-size:9pt
}
.tx1 { height: 20px;font-size: 9pt; border: 1px solid; border-color: #000000; color: #0000FF}
-->
</style>
<link href="Manage/Inc/ManageMent.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%
if EnableUploadFile="Yes" then
%>
<form action="upfilea.asp" method="post" name="form1" enctype="multipart/form-data">
<input name="FileName" type="FILE" class="tx1" size="20">
<input type="submit" name="Submit" value="上傳" style="border:1px double rgb(88‚88‚88);font:9pt">
</form>
<%
end if
%>
</body>
</html>
============================
第四個文件:upfilea.asp
<!--#include file="Inc/config.asp"-->
<!--#include file="Inc/upload.asp"-->
<%
const upload_type=0 '上傳方法:0=無懼無組件上傳類,1=FSO上傳 2=lyfupload,3=aspupload,4=chinaaspupload
dim upload‚file‚formName‚SavePath‚filename‚fileExt
dim upNum
dim EnableUpload
dim Forumupload
dim ranNum
dim uploadfiletype
dim msg‚founderr
msg=""
founderr=false
EnableUpload=false
SavePath = "Upload" '存放上傳文件的目錄
if right(SavePath‚1)<>"/" then SavePath=SavePath&"/" '在目錄後加(/)
%>
<%
ComeinSTR=lcase(request.servervariables("HTTP_HOST"))
Url=split(ComeinSTR)
yourthing=Url(0)
%>
<html>
<head>
<link href="Manage/Inc/ManageMent.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
if EnableUploadFile="NO" then
response.write "系統未開放文件上傳功能"
else
select case upload_type
case 0
call upload_0() '使用化境無組件上傳類
case else
end select
end if
%>
</body>
</html>
<%
sub upload_0() '使用化境無組件上傳類
set upload=new upload_file '建立上傳對象
for each formName in upload.file '列出所有上傳了的文件
set file=upload.file(formName) '生成一個文件對象
if file.filesize<100 then
msg="請先選擇你要上傳的文件!"
founderr=true
end if
if file.filesize>(MaxFileSize*1024) then
msg="文件大小超過了限制,最大隻能上傳" & CStr(MaxFileSize) & "K的文件!"
founderr=true
end if
fileExt=lcase(file.FileExt)
Forumupload=split(UpFileType‚"|")
for i=0 to ubound(Forumupload)
if fileEXT=trim(Forumupload(i)) then
EnableUpload=true
exit for
end if
next
if fileEXT="asp" or fileEXT="asa" or fileEXT="aspx" then
EnableUpload=false
end if
if EnableUpload=false then
'msg="這種文件類型不允許上傳!\n\n只允許上傳這幾種文件類型:" & UpFileType
response.write"<script language=javascript>alert('這種文件類型不允許上傳!\n\n只允許上傳這幾種文件類型:" &
UpFileType & "');"
response.write"javascript:history.go(-1)</script>"
founderr=true
end if
strJS="<script language=javascript>" & vbcrlf
if founderr<>true then
randomize
ranNum=int(900*rnd)+100
filename=SavePath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
file.SaveToFile Server.mappath(FileName) '保存文件
msg="上傳文件成功!"
FileType=right(fileExt‚3)
select case FileType
case "jpg"‚"gif"‚"png"‚"bmp"
case "swf"
case else
strJS=strJS & "range.text=' 點擊瀏覽該文件';" & vbcrlf
end select
end if
strJS=strJS & "alert('" & msg & "');" & vbcrlf
strJS=strJS & "</script>"
response.write strJS
response.write "圖片上傳成功!文件路徑是 /" & filename & "<br>"
response.write "http://";; & yourthing & "/" & filename & "<br>"
set file=nothing
next
set upload=nothing
end sub
%>
④ 在網上買了一個ASP貨源導航源碼,想改成PHP或HTML的,要怎麼樣修改有什麼工具嗎,說的具體點。
淘寶上有修改的,不過還是建議你不要用ASP源碼了,安全系數不高,FSO工具可以轉為HTML,如果不想花太多錢,在淘寶上搜一下DedeCms,用最新版本工具可以仿模版的,價格也不高,可以了解一下。
⑤ 如何查看ASP源碼到底是什麼內容
把網站源碼先下載到本地,然後用dreamweaver打開,查看,找到不想要的地方,然後刪除就行了。我估計你是一點都不會。我猜你是要刪除資料庫里的內容,而不是asp程序中的內容。小網站一般是access,office辦公軟體系列中的一個,安裝好後,打開下載的資料庫,自己慢慢找了
⑥ asp 企業網站源碼產品展示
基本如76887188所示代碼,但76887188的代碼中還有一個錯誤和一些冗餘的代碼,所以影響了使用,無錯代碼如下:
<!--代碼開始-->
<img onmousemove="javascript:change_style(this);if(this.width>500)this.width=500" id="this_img" style="CURSOR: url
('http://www.feiyuc.com/site/images/pre.cur');border: 1 solid #000000" onclick="click_pic(this);" alt="[竹傢具]圖片:點擊跳到
上一張" src="http://www.feiyuc.com/site/gb_upfile/222/222_2009423164525469_1.jpg" onload="javascript:if(this.width>500)
this.width=500">
<script>
function click_pic(o) {
if(event.offsetX <= o.clientWidth/2)
goPage("pre");
else
goPage("next");
}
function goPage (page) {
switch(page) {
case "pre": window.location="?userid=222&id=16005"; break;
case "next":window.location="?userid=222&id=32468"; break;
}
}
function change_style(o) {
if(event.offsetX <= o.clientWidth/2 ) {
if( !o.style.cursor.match("pre") )
o.style.cursor = "url("+"http://www.feiyuc.com/site/images/pre.cur"+")";
if( o.alt != "[竹傢具]圖片:點擊跳到上一張" )
o.alt = "[竹傢具]圖片:點擊跳到上一張";
}
else if( !o.style.cursor.match("next") ){
o.style.cursor="url("+"http://www.feiyuc.com/site/images/next.cur"+")";
if( o.alt != "[竹傢具]圖片:點擊跳到下一張" )
o.alt = "[竹傢具]圖片:點擊跳到下一張";
}
return;
}
</script>
<!--代碼結束-->
將以上代碼中實際圖片地址http://www.feiyuc.com/site/gb_upfile/222/222_2009423164525469_1.jpg替換成你的圖片地址,再將以上代碼放到你的展示區即可!
如果是在ASP中,只需要將有鏈接接部分換成資料庫中相應的欄位就可以了啊!
即:
<!--這里放打開存放展示產品的資料庫ASP代碼(如果不會寫哪建議你去學習一下ASP基礎知識再來討論這個問題^_^)-->
<img onmousemove="javascript:change_style(this);if(this.width>500)this.width=500" id="this_img" style="CURSOR: url
('<%=rs("點擊圖片打開的鏈接")%>');border: 1 solid #000000" onclick="click_pic(this);" alt="[竹傢具]圖片:點擊跳到
上一張" src="<%=rs("展示圖片地址!")%>" onload="javascript:if(this.width>500)
this.width=500">
=================================
JS代碼用document.write來寫
即
document.write "<script>......</script>";
記得將雙引號"換成單引號',還就是將上一張和下一張的鏈接即下面的代碼
switch(page) {
case "pre": window.location="?userid=222&id=16005"; break;
case "next":window.location="?userid=222&id=32468"; break;
}
中的id=換成相應上一張和下一張對應的資料庫中的ID號就行了;
⑦ 求ASP代碼
1.
<%
a=request("num")
if a mod 2=0 then
response.write "偶數"
else
response.write "奇數"
end if
%>
2.
<%
a=request("價錢")
if a>100 then a=a+(a-100)*0.8
if a>50 and a<=100 then a=a* 0.9
response.write a
%>
3.
<%
if day(now)=25 then response.write "明天可能有病毒發作"
%>
4.有點復雜
用到application 具體的可網上查下 很簡單的 總訪問人數用個fso可以實現了
5.你看下globa.asa說明
⑧ asp源文件
你說的看asp源碼,是看它製作的效果吧,我想,你需要裝一個IIS,然後,把你下的asp源碼存放的目錄設為虛擬目錄,然後用IE打開它~!或者,你試試dreamweaver這個軟體,它能看到部份設計效果~!
⑨ 做一個asp的小型拍賣網站大概多少錢
現在應該起不過3000元。應該會用SQL,估計沒人用ACCESS了。
⑩ asp系統怎麼用啊網站源碼
首頁你本地電腦必須安裝有IIS伺服器。這樣才能運行ASP程序。接著你要下載dreamweaver,這個是網站排版,程序開發,測試網站的工具。要想看懂源碼,需要很邁長的時間。要有絕對的信心拿下它。