<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Server.ScriptTimeOut=5000
'On Error Resume Next
dbs="../"
%>
<!--#include file="../inc/config.asp"-->
<!--#include file="uccook.asp"-->
<!--#include file="uc.asp"-->
<!--#include FILE="../inc/UpLoadClass.asp"-->
<!--#include file="../inc/Code2Info.en.asp"-->
<%
dim request2 
set request2=New UpLoadClass
request2.AutoSave=2
request2.Open()
'判断 用户是否开通功能
Uname=Replace(Replace(Left(request2.Form("Uname"),20),"<","["),">","]")
UQQ=Replace(Replace(Left(request2.Form("UQQ"),20),"<","["),">","]")
UAddress=Replace(Replace(Left(request2.Form("UAddress"),100),"<","["),">","]")
UDetails=Replace(Replace(Left(request2.Form("UDetails"),500),"<","["),">","]")
if Uname="" then
response.Write "<script >alert('提示：\n\n对不起，请填写网名！...');history.back(-1);</script>"
response.End()
end if
request2.FileType="gif/jpg"
request2.MaxSize=15360000
request2.SavePath="../UpLoadUC/"
if request2.Save("Upic",0) then
	Upic=request2.Form("Upic")
end if
old_H_pic=conn.execute("select Upic from H_user where ID="&UID&"")("Upic")
if old_H_pic="" or isnull(old_H_pic) then
if Upic="" then
response.Write "<script >alert('提示：\n\n对不起，第一次必须上传头像！...');history.back(-1);</script>"
response.End()
end if
end if
if Upic<>"" then
						'''开始删除文件
								Dim objFSO         '声明一个名称为   objFSO   的变量以存放对象实例   
								Set objFSO   =   Server.CreateObject("Scripting.FileSystemObject")   
									objFSO.DeleteFile   Server.MapPath("../UpLoadUC/"&old_H_pic&""),True   
								Set objFSO   =   Nothing             '释放   FileSystemObject   对象实例内存空间  
						''删除文件结束
					end  if
''开始写入数据
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_user where id="&UID&""
	rs.open sql,conn,1,3
	rs("Uname")=Uname
	rs("UQQ")=UQQ
	rs("UAddress")=UAddress
	if upic<>"" then
	rs("upic")=upic
	end if
	rs("UDetails")=UDetails
	rs.update
	rs.close
	set rs=nothing	
	response.Write "<script >alert('提示：\n\n修改成功,立即返回...');location.href='Profile_Edit.asp';</script>"
	response.End()
%>