<!-- #include file="conn.asp" -->
<!-- #include file="cls_main.asp" -->
<!-- #include file="cls_upload.asp" -->
<!-- #include file="cls_md5.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员中心</title>
<link href="User_Style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="800"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td colspan="3"><img src="images/user_top.gif" width="800" height="13"></td>
  </tr>
  <tr>
    <td width="10">&nbsp;</td>
    <td width="190"><img src="images/User_Logo.gif" width="150" height="72"></td>
    <td width="600" align="right"><table  border="0" cellpadding="0" cellspacing="1">
        <tr>
          <td>·<a href="default.html">站点首页</a> ·<a href="downnew/0_1.html">最近更新</a> ·<a href="downtop/1_1.html">下载排行</a> </td>
          <td>·<a href="UserLogin.asp?action=logout">退出登录</a></td>
          <td width="10">&nbsp;</td>
        </tr>
      </table>
        <table  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="52" align="center" background="images/user_bg.gif"><img src="images/user_bg1.gif" width="8" height="52" align="absmiddle">&nbsp;<a href="User_Index.asp">会员中心</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Down_Upload.asp">上传软件</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Down_Resource.asp">添加软件</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Down_Reslist.asp">软件管理</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Cms_Resource.asp">添加文章</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Cms_Reslist.asp">文章管理</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Modfiy.asp">资料修改</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_BuyPoints.asp">帐号充值</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_List.asp">会员列表</a>&nbsp;<img src="images/user_bg2.gif" width="10" height="52" align="absmiddle"></td>
          </tr>
      </table></td>
  </tr>
</table>
<table width="800" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="400" valign="top">
	
<%
Dim Mesky
Set Mesky = New cls_main
       If Mesky.MemberUserName = "" Then
            Mesky.strMsg = "<li>非法操作，您没有登录系统，<a href=""UserLogin.asp"">点击此处进入登录界面</a>。"
            Call Mesky.SystemMsg
        Else
            Call Main()
        End If
Set Mesky = nothing

Sub Main()
	if Request("action") = "upfiles" then
		call upfiles()
	ElseIf Request("action") = "save" then
		call saveRes()
	Else
		call upform()
	End If
End Sub
Sub upfiles()
    If Mesky.ChkPost = False Then
        Mesky.strMsg = "非法操作，不要从外部提交数据。"
        Call Mesky.SystemMsg
        Exit Sub
    End If
	Server.ScriptTimeOut=5000
	response.Buffer=true
	dim obj,upPath,c,fileName,filesize

	Call Mesky.Loadsetting
	upPath = Mesky.setting(61) & Right("0000000" & Mesky.MemberUserID, 8)&"/"
	set obj = New UpLoadClass
	c = CreatePath(Server.MapPath(upPath))
	'上传目录
	obj.SavePath = upPath
	'上传总大小为1000M
	obj.TotalSize= 1048576000
	'单文件最大500M
	obj.MaxSize  = 524288000
	obj.FileType = "rar/zip/exe/jpg/gif/swf/ppt/doc/txt"
	obj.Open()
	
	if obj.Error=4 then
		set obj = nothing
		set Mesky.strMsg = "<li>总数据量超过限制，上传失败！</li>"
		Call Mesky.SystemMsg
		Exit Sub		
	End If
	
	fileSize = obj.Form("filename1_Size")\1024
	fileName = obj.SavePath&obj.Form("filename1")
	set obj = nothing
	
	'exit Sub
    Dim i, strArr
    Response.Write "   <table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
    Response.Write "<tr><td align=""center"" background=""images/menubg.gif"" colspan=""2"">第二步 填写资源信息</td></tr>"
    Response.Write "     <COLGROUP>" & vbCrLf
    Response.Write "    <COL width=""65"">" & vbCrLf
    Response.Write "    <COL width=""*"">" & vbCrLf
    Response.Write "<SCRIPT LANGUAGE=javascript>" & vbCrLf
    Response.Write "<!--" & vbCrLf
    Response.Write "function SelectColor(){" & vbCrLf
    Response.Write "    var arr = showModalDialog(""eWebEditor/Dialog/selcolor.htm"", """", ""dialogWidth:20em; dialogHeight:16em; status:0;help=no"");" & vbCrLf
    Response.Write "    if (arr ==null){" & vbCrLf
    Response.Write "        myform.FontColor.value="""";" & vbCrLf
    Response.Write "        alert(""系统提示：当前没有选择颜色，系统将启用页面默认颜色，或重新选择！"");" & vbCrLf
    Response.Write "        myform.FontColor.focus();" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "    if (arr !=null){" & vbCrLf
    Response.Write "        myform.FontColor.value=arr;" & vbCrLf
    Response.Write "        myform.FontColor.style.backgroundColor=arr;" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "}" & vbCrLf
    Response.Write "//-->" & vbCrLf
    Response.Write "<!--" & vbCrLf
    Response.Write "function SetSmallImg(){" & vbCrLf
    Response.Write "    var arr = showModalDialog(""eWebEditor/Upload_Images_Dialog.asp?style=s_meskycn"", """", ""dialogWidth:26em; dialogHeight:10em; status:0;help=no"");" & vbCrLf
    Response.Write "    if (arr ==null){" & vbCrLf
    Response.Write "        myform.SmallImg.value="""";" & vbCrLf
    Response.Write "        alert(""系统提示：当前没有上传图片，资源缩略图为空，用户可以重新上传图片！"");" & vbCrLf
    Response.Write "        //myform.SmallImg.focus();" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "    if (arr !=null){" & vbCrLf
    Response.Write "        myform.SmallImg.value=arr;" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "}" & vbCrLf
    Response.Write "//-->" & vbCrLf
    Response.Write "<!--" & vbCrLf
    Response.Write "function SetPreviewImg(){" & vbCrLf
    Response.Write "    var arr = showModalDialog(""eWebEditor/Upload_Images_Dialog.asp?style=s_meskycn"", """", ""dialogWidth:26em; dialogHeight:10em; status:0;help=no"");" & vbCrLf
    Response.Write "    if (arr ==null){" & vbCrLf
    Response.Write "        myform.PreviewImg.value="""";" & vbCrLf
    Response.Write "        alert(""系统提示：当前没有上传图片，界面预览图为空，用户可以重新上传图片！"");" & vbCrLf
    Response.Write "        //myform.PreviewImg.focus();" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "    if (arr !=null){" & vbCrLf
    Response.Write "        myform.PreviewImg.value=arr;" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "}" & vbCrLf
    Response.Write "//-->" & vbCrLf
    Response.Write "<!--" & vbCrLf
    Response.Write "// 表单提交客户端检测" & vbCrLf
    Response.Write "function VF_myform(){ //v2.0" & vbCrLf
    Response.Write "<!--start_of_saved_settings-->" & vbCrLf
    Response.Write "<!--type,text,name,ResSize,required,true,isNum,errMsg,资源大小必须填写数字格式。-->" & vbCrLf
    Response.Write "<!--type,select,name,strCatalog,isDefault,errMsg,必须设置资源分类！-->" & vbCrLf
    Response.Write "<!--type,text,name,ResName,required,true,errMsg,资源名称必须填写！-->" & vbCrLf
    Response.Write "<!--end_of_saved_settings-->" & vbCrLf
    Response.Write "    var theForm = document.myform;" & vbCrLf
    Response.Write "    var numRE = /^\d+$/;" & vbCrLf
    Response.Write "    var sFlg_strCatalog = false;" & vbCrLf
    Response.Write "    var errMsg = """";" & vbCrLf
    Response.Write "    var setfocus = """";" & vbCrLf
    Response.Write vbCrLf
    Response.Write "    for(var s4=0;s4<theForm['strCatalog'].length;s4++){if(theForm['strCatalog'].options[s4].selected){if(theForm['strCatalog'].options[s4].text==theForm['strCatalog'].options[0].text)sFlg_strCatalog=true;}}" & vbCrLf
    Response.Write vbCrLf
    Response.Write "    if (!numRE.test(theForm['ResSize'].value)){" & vbCrLf
    Response.Write "        errMsg = ""资源大小必须填写数字格式。"";" & vbCrLf
    Response.Write "        setfocus = ""['ResSize']"";" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "    if (sFlg_strCatalog){" & vbCrLf
    Response.Write "        errMsg = ""必须设置资源分类！"";" & vbCrLf
    Response.Write "        setfocus = ""['strCatalog']"";" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "    if (theForm['ResName'].value == """"){" & vbCrLf
    Response.Write "        errMsg = ""资源名称必须填写！"";" & vbCrLf
    Response.Write "        setfocus = ""['ResName']"";" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "    if (eWebEditor1.getHTML()==""""){" & vbCrLf
    Response.Write "        alert(""资源介绍不能为空！"");" & vbCrLf
    Response.Write "        return false;" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "    if (errMsg != """"){" & vbCrLf
    Response.Write "        alert(errMsg);" & vbCrLf
    Response.Write "        eval(""theForm"" + setfocus + "".focus()"");" & vbCrLf
    Response.Write "        return false;" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "    else" & vbCrLf
    Response.Write "    //theForm.content.value=eWebEditor1.getHTML();" & vbCrLf
    Response.Write "    theForm.submit();" & vbCrLf
    Response.Write "}//-->" & vbCrLf
    Response.Write "</script>" & vbCrLf
    Response.Write "<style type=""text/css"">" & vbCrLf
    Response.Write "label{cursor:hand;}" & vbCrLf
    Response.Write "</style>" & vbCrLf
    Response.Write "   <form action=""User_Down_Upload.asp"" method=""post"" name=""myform"">" & vbCrLf
    Response.Write "        <input type=""Hidden"" name=""action"" value=""save"">" & vbCrLf
    Response.Write "          <tr class=""tdbg2"">" & vbCrLf
    Response.Write "            <td align=""right"">资源名称：</td>" & vbCrLf
    Response.Write "            <td ><input type=""text"" name=""ResName"" size=""45"" value="""" maxlength=""100"" tabindex=""1""> " & vbCrLf
    Response.Write "              <font color=""#FF0000"">！</font> 版本：<input type=""text"" name=""ResVer"" maxlength=""100"" size=""20"" value=""""> 颜色：<input type=""text"" name=""FontColor"" id=""titlecolor"" size=""6"" onclick=""SelectColor();"" readonly " & vbCrLf
    Response.Write "> <select name=""FontType"" id=""FontType"">" & vbCrLf
    Response.Write "                <option value=""0"">字形</option> " & vbCrLf
        Response.Write "                <option value=""1"">粗体</option>" & vbCrLf
        Response.Write "                <option value=""2"">斜体</option>" & vbCrLf
        Response.Write "                <option value=""3"">粗+斜</option>" & vbCrLf
    Response.Write "                <option value=""0"">规则</option>" & vbCrLf
    Response.Write "              </select></td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg2""> " & vbCrLf
    Response.Write "            <td align=""right"">所属分类：</td>" & vbCrLf
    Response.Write "            <td > <select name=""strCatalog"" tabindex=""2"">" & vbCrLf
    Response.Write "                <option value="""">↓请选择栏目↓</option>" & vbCrLf
        If Request.QueryString("catalogID") <> "" Then
            Response.Write Mesky.GetCatalogSelect(CLng(Request.QueryString("catalogID")), "Mesky_Down_Catalog")
        Else
            Response.Write Mesky.GetCatalogSelect(0, "Mesky_Down_Catalog")
        End If
    Response.Write " </select> <font color=""#FF0000"">！</font> 软件大小：<input type=""text"" name=""ResSize"" size=""14"" maxlength=""10""  value="""&fileSize&""" readonly> " & vbCrLf
    Response.Write "              <input name=""SizeUnit"" type=""radio"" value=""KB"" checked id=""kb""><label for=""kb"">KB</label> " & vbCrLf
    Response.Write "              <input type=""radio"" name=""SizeUnit"" value=""MB"" id=""mb""><label for=""mb"">MB</label> " & vbCrLf
    Response.Write "              <font color=""#FF0000"">！</font>关键字：<input type=""text"" name=""Keys"" size=""25"" maxlength=""100""  value=""""></td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg3"">" & vbCrLf
    Response.Write "            <td align=""right"" nowrap>运行环境：</td>" & vbCrLf
    Response.Write "            <td>"
    strArr = split(Mesky.setting(144),",")
    For i = 0 To UBound(strArr)
        Response.Write "<input type=""checkbox"" name=""System"" value=""" & strArr(i) & """ "
		If InStr(Mesky.Setting(145), Trim(strArr(i))) > 0 Then
            Response.Write "checked"
        End If
        Response.Write " id=""system" & i & """><label for=""system" & i & """>" & Trim(strArr(i)) & "</label> "
        If i = 5 Then Response.Write "<br>"
    Next
    Response.Write "              <font color=""#FF0000"">！</font> </td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg2""> " & vbCrLf
    Response.Write "            <td align=""right"" nowrap>资源等级：</td>" & vbCrLf
    Response.Write "            <td>"
    For i = 1 To Mesky.Setting(139)
        Response.Write "<input type=""radio"" name=""ResRank"" value=""" & i & """"
        If i = Mesky.Setting(139) \ 2 + 1 Then Response.Write " checked"
        Response.Write " id=""stars" & i & """><label for=""stars" & i & """>" & i & "星</label>" & vbCrLf
    Next
    Response.Write "              <font color=""#FF0000""> ！</font> </td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg3""> " & vbCrLf
    Response.Write "            <td align=""right"" nowrap>授权类型：</td>" & vbCrLf
    Response.Write "            <td>"
    strArr = split(Mesky.setting(141),",")
    For i = 0 To UBound(strArr)
        Response.Write "<input type=""radio"" name=""ResLicence"" value=""" & strArr(i) & """"
        If i = 0 Then Response.Write " checked"
        Response.Write " id=""ResLicence" & i & """><label for=""ResLicence" & i & """>" & strArr(i) & "</label>" & vbCrLf
    Next
    Response.Write "              <font color=""#FF0000"">！</font> </td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg2"">" & vbCrLf
    Response.Write "            <td align=""right"" nowrap>性质类型：</td>" & vbCrLf
    Response.Write "            <td>"
    strArr = split(Mesky.setting(142),",")
    For i = 0 To UBound(strArr)
        Response.Write "<input type=""radio"" name=""ResType"" value=""" & strArr(i) & """"
        If i = 0 Then Response.Write " checked"
            Response.Write " id=""ResType" & i & """><label for=""ResType" & i & """>" & strArr(i) & "</label>" & vbCrLf
    Next
    Response.Write "              <font color=""#FF0000"">！</font></td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg3""> " & vbCrLf
    Response.Write "            <td align=""right"" nowrap>语言类型：</td>" & vbCrLf
    Response.Write "            <td>"
    strArr = split(Mesky.setting(143),",")
    For i = 0 To UBound(strArr)
        Response.Write "<input type=""radio"" name=""ResLanguage"" value=""" & strArr(i) & """"
            If i = 0 Then Response.Write " checked"
        Response.Write " id=""ResLanguage" & i & """><label for=""ResLanguage" & i & """>" & strArr(i) & "</label>" & vbCrLf
    Next
    Response.Write "              <font color=""#FF0000"">！</font></td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg2""> " & vbCrLf
    Response.Write "            <td align=""right"" nowrap>其他设置：</td>" & vbCrLf
    Response.Write "            <td >" & vbCrLf
    Response.Write "            <input name=""isHot"" type=""checkbox"" id=""isHot"" value=""1"" "
    Response.Write "><label for=""isHot"">推荐下载</label> " & vbCrLf
    Response.Write "              <input name=""isTop"" type=""checkbox"" id=""isTop"" value=""1"" "
    Response.Write "><label for=""isTop"">固顶下载</label>" & vbCrLf
    Response.Write "            <input name=""isBest"" type=""checkbox"" id=""isBest"" value=""1"" "
    Response.Write "><label for=""isBest"">热门下载</label>" & vbCrLf
    Response.Write "            下载点数：<input type=""text"" name=""UserPoints"" size=""4"" maxlength=""4""  value=""0"">" & vbCrLf
    Response.Write "            下载级别：<select name=""UserClass"">" & vbCrLf
    strArr = split(Mesky.setting(140),",")
    For i = 0 To UBound(strArr)
        Response.Write "          <option value=""" & i & """>" & strArr(i) & "</option>"
    Next
    Response.Write " </select>" & vbCrLf
    Response.Write "            </td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg3""> " & vbCrLf
    Response.Write "            <td align=""right"" nowrap>作者网址：</td>" & vbCrLf
    Response.Write "            <td><input type=""text"" name=""authorURL"" size=""38"" maxlength=""100""  value="""
    Response.Write """>" & vbCrLf
    Response.Write "            作者邮箱：<input type=""text"" name=""authorEmail"" size=""25"" maxlength=""100""  value="""
    Response.Write """> </td>" & vbCrLf
    Response.Write "            </td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg2""> " & vbCrLf
    Response.Write "            <td align=""right"" nowrap>注册网址：</td>" & vbCrLf
    Response.Write "            <td ><input type=""text"" name=""RegURL"" size=""38""  value="""
    Response.Write """>" & vbCrLf
    Response.Write "              共享软件注册的网址链接</td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg3""> " & vbCrLf
    Response.Write "            <td align=""right"" nowrap>界面预览： </td>" & vbCrLf
    Response.Write "            <td > <input type=""text"" name=""PreviewImg"" size=""38""  value="""

    Response.Write """>" & vbCrLf
    Response.Write "              <input type=""button"" value=""设置"" onclick=""SetPreviewImg();""> 资源界面预览图片，大小不定</td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg2""> " & vbCrLf
    Response.Write "            <td align=""right"" nowrap>缩 略 图：</td>" & vbCrLf
    Response.Write "            <td > <input type=""text"" name=""SmallImg"" size=""38""  value="""
    Response.Write """>" & vbCrLf
    Response.Write "            <input type=""button"" value=""设置"" onclick=""SetSmallImg();"">" & vbCrLf
    Response.Write "              资源的缩略图，建议大小为：135×120 px</td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "          <tr class=""tdbg2""> " & vbCrLf
    Response.Write "            <td align=""right"">资源介绍：</td>" & vbCrLf
    Response.Write "            <td ><TEXTAREA name=content id=content style=""display:none""></TEXTAREA>" & vbCrLf
    Response.Write "<INPUT type=""hidden"" name=""content1"" value="""">" & vbCrLf
    Response.Write "              <IFRAME ID=""eWebEditor1"" src=""ewebeditor/ewebeditor.asp?id=content1&style=s_meskycn"" frameborder=""0"" scrolling=""no"" width=""600"" height=""300""></IFRAME> </td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf

	Response.Write "   <tr class=""tdbg3""> " & vbCrLf
	Response.Write "            <td colspan=""4""> " & vbCrLf
	Response.Write "              <table width=""100%"" border=""0"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
	Response.Write "                <tr> " & vbCrLf
	Response.Write "                  <td width=""75"" align=""right"">下载名称：</td>" & vbCrLf
	Response.Write "                  <td><input name=""Name"" type=""text"" size=""45"" maxlength=""100"" value=""""> "
	Response.Write " &nbsp;&nbsp;&nbsp;&nbsp;预定义站点：<select name=""SiteID"">" & vbCrLf
	Response.Write "                      <option value=""0"">不使用预定义</option>" & vbCrLf
	Dim temRs
	set temRs = Mesky.Execute("select ID,SiteName from Mesky_Down_SiteSetting")
	If Not (temRs.EOF And temRs.bof) Then
		Do While Not temRs.EOF
		Response.Write "          <option value=""" & temRs(0) & """"
		Response.Write ">→" & temRs(1) & "</option>"
		temRs.movenext
		Loop
	End If
	Set temRs = Nothing
	Response.Write "                    </select></td>" & vbCrLf
	Response.Write "                </tr>" & vbCrLf
	Response.Write "                <tr> " & vbCrLf
	Response.Write "                  <td width=""75"" align=""right"">下载 URL：</td>" & vbCrLf
	Response.Write "                  <td><input name=""Url"" type=""text"" size=""70"" maxlength=""200"" value=""" & fileName & """ readonly></td>" & vbCrLf
	Response.Write "                </tr>" & vbCrLf
	Response.Write "                <tr bgcolor=""#CCCCCC""> " & vbCrLf
	Response.Write "                  <td height=""1"" colspan=""2""></td>" & vbCrLf
	Response.Write "                </tr>" & vbCrLf
	Response.Write "      </table></td>" & vbCrLf
	Response.Write "          </tr>" & vbCrLf

    Response.Write "          <tr class=""tdbg2""> " & vbCrLf
    Response.Write "            <td align=""right"">&nbsp;</td>" & vbCrLf
    Response.Write "            <td > <input type=""button"" name=""btnSubmit"" value="" 提 交 "" onclick=""VF_myform()"">" & vbCrLf
      
    Response.Write "       </td>" & vbCrLf
    Response.Write "          </tr>" & vbCrLf
    Response.Write "     </form>" & vbCrLf
    Response.Write "        </table>" & vbCrLf

End sub
Private Sub saveRes()
    If Mesky.ChkPost = False Then
        Mesky.strMsg = "非法操作，不要从外部提交数据。"
        Call Mesky.SystemMsg
        Exit Sub
    End If
    If Not IsObject(Conn) Then Call ConnectionDatabase
    Dim Rs, sql, splCatalog, sID, sContent, i, sKeys
    Set Rs = Server.CreateObject("adodb.recordset")
    sql = "select * from Mesky_Down_Resource where (ID is null)"
    Rs.Open sql, Conn, 1, 3
    Rs.addnew
    Rs("ResName") = Trim(Request.Form("ResName"))
    Rs("ResVer") = Trim(Request.Form("ResVer"))
    If Trim(Request.Form("Keys")) = "" Then
        sKeys = Trim(Request.Form("ResName"))
    Else
        sKeys = Trim(Request.Form("Keys"))
    End If
    Rs("Keys") = sKeys
    '0=RootID;1=CatalogID;2=Depth;3=CatalogName
    splCatalog = Split(Trim(Request.Form("strCatalog")), ",")
    Rs("RootID") = splCatalog(0)
    Rs("CatalogID") = splCatalog(1)
    Rs("CatalogName") = splCatalog(3)
    Rs("Depth") = splCatalog(2)
    For i = 1 To Request("content1").Count
        sContent = sContent & Request("content1")(i)
    Next
    'sContent = Request.Form("content")
    'Response.Write(sContent)
    Rs("Content") = sContent
    Rs("Excerpt") = Mesky.cutStr(Mesky.GetTextFromHtml(sContent), 200)
    Rs("IndexKeys") = Mesky.GetSpellChar(Trim(Request.Form("ResName")))
    Rs("md5") = MD5(Trim(Request.Form("ResName")), 32)
    Rs("FontColor") = Trim(Request.Form("FontColor"))
    Rs("FontType") = Trim(Request.Form("FontType"))
    Rs("SmallImg") = Trim(Request.Form("SmallImg"))
    Rs("PreviewImg") = Trim(Request.Form("PreviewImg"))
    Rs("authorURL") = Trim(Request.Form("authorURL"))
    Rs("authorEmail") = Trim(Request.Form("authorEmail"))
    Rs("RegURL") = Trim(Request.Form("RegURL"))
    Rs("ResLicence") = Trim(Request.Form("ResLicence"))
    If Trim(Request.Form("SizeUnit")) = "MB" Then
        Rs("ResSize") = Trim(Request.Form("ResSize")) * 1024
    Else
        Rs("ResSize") = Trim(Request.Form("ResSize"))
    End If
    Rs("ResLanguage") = Trim(Request.Form("ResLanguage"))
    Rs("System") = Trim(Request.Form("System"))
    Rs("ResRank") = Trim(Request.Form("ResRank"))
    Rs("ResType") = Trim(Request.Form("ResType"))
    If Request.Form("isHot") = 1 Then
        Rs("isHot") = 1
    Else
        Rs("isHot") = 0
    End If
    If Request.Form("isTop") = 1 Then
        Rs("isTop") = 1
    Else
        Rs("isTop") = 0
    End If
    If Request.Form("isBest") = 1 Then
        Rs("isBest") = 1
    Else
        Rs("isBest") = 0
    End If
    Rs("isError") = 0
    Rs("UserPoints") = Trim(Request.Form("UserPoints"))
    Rs("HitsToday") = 0
    Rs("DateToday") = Now()
    Rs("HitsWeek") = 0
    Rs("DateWeek") = Now()
    Rs("HitsMonth") = 0
    Rs("DateMonth") = Now()
    Rs("HitsTotal") = 0
    Rs("isAuditing") = 0
    Rs("UserName") = Mesky.MemberUserName
    Rs("DateAndTime") = Now()
    Rs("UpdateTime") = Now()
    Rs("MutualityDown") = ""
    Rs("MutualityCms") = ""
    Rs("CommentNum") = 0
    Rs("Grade") = 0
    Rs.Update
    sID = Mesky.Execute("select max(id) from Mesky_Down_Resource")(0)
    Rs.Close

    
    Dim splName, splUrl, splSiteID, iii
    If Request.Form("Url") <> "" Then
        splName = Split(Request.Form("Name"), ",")
        splUrl = Split(Request.Form("Url"), ",")
        splSiteID = Split(Request.Form("siteID"), ",")
        For iii = 0 To UBound(splUrl)
        If Not (splUrl(iii) = "" Or splUrl(iii) = " ") Then
            sql = "select * from Mesky_Down_Address where (ID is null)"
            Rs.Open sql, Conn, 1, 3
            Rs.addnew
            Rs("Name") = Trim(splName(iii))
            Rs("Url") = Trim(splUrl(iii))
            Rs("ResourceID") = sID
            Rs("Hits") = 0
            Rs("SiteID") = Trim(splSiteID(iii))
            Rs.Update
            Rs.Close
        End If
        Next
    End If
    Set Rs = Nothing

    '更新本分类的资源统计
    Mesky.Execute ("update Mesky_Down_Catalog set isUpdate=1,ResNum=ResNum+1 where CatalogId=" & splCatalog(1))
    '更新同根分类的父级资源数统计 '0=RootID;1=CatalogID;2=Depth;3=CatalogName
    Mesky.Execute ("update Mesky_Down_Catalog set isUpdate=1,ResNum=ResNum+1 where RootId=" & splCatalog(0) & " and Depth>" & splCatalog(2) & " and isShowAllRes=1")
    
    Mesky.strMsg = "<li>添加下载资源操作成功，可以继续以下操作。" & _
    "<li>操作一：<a href=""?s="">继续添加新下载资源</a>" & _
    "<li>操作二：<a href=""?catalogID=" & splCatalog(1) & """>继续在分类[" & splCatalog(3) & "]中添加新下载资源</a>" & _
    "<li>操作三：<a href=""?action=edit&id=" & sID & """>修改编辑下载资源[" & Trim(Request.Form("ResName")) & " " & Trim(Request.Form("ResVer")) & "]的信息。</li>"
    Call Mesky.SystemMsg

End Sub
'########################
Private Function CreatePath(sPath) '创建文件夹函数, sPath为文件夹绝对路径,可以是多层文件夹
'########################
	Dim f,pos,aTmp,sNewPath,n
	If Instr(sPath,"\")>0 Then
		Set f = Server.CreateObject(Mesky.setting(23))
		pos=Instr(3,sPath,"\",1)
		aTmp=Split(Mid(sPath,pos+1),"\")
		sNewPath=Left(sPath,pos-1)
		For n = 0 to Ubound(aTmp)
			On Error resume next 'Ignore permission problems on higher levels
			sNewPath = sNewPath & "\" & aTmp(n)
			If aTmp(n)<>"" AND NOT f.FolderExists(sNewPath) Then f.CreateFolder sNewPath
		Next
		If f.FolderExists(sPath) Then CreatePath=True Else CreatePath=False
		Set f=Nothing
	End If
End Function
	
sub upform() %>
      <table width="100%" border="0" cellpadding="3" cellspacing="1">
		<form action="?action=upfiles" enctype="multipart/form-data" name="form1" method="post">
        <tr>
          <td height="19" colspan="2" align="center" background="images/menubg.gif">第一步　上传文件</td>
          </tr>
        <tr class="tdbg3">
          <td align="right">文件类型：</td>
          <td>.rar/.zip/.exe/.jpg/.gif/.swf/.ppt/.doc/.txt</td>
        </tr>
        <tr class="tdbg2">
          <td align="right">选择上传文件：</td>
          <td><input name="filename1" type="file" id="filename1" size="50"></td>
        </tr><!--
        <tr class="tdbg3">
          <td align="right">选择上传文件：</td>
          <td><input name="filename2" type="file" id="filename2" size="50"></td>
        </tr>
        <tr class="tdbg2">
          <td align="right">选择上传文件：</td>
          <td><input name="filename3" type="file" id="filename3" size="50"></td>
        </tr>
        <tr class="tdbg3">
          <td align="right">选择上传文件：</td>
          <td><input name="filename4" type="file" id="filename4" size="50"></td>
        </tr>
        <tr class="tdbg2">
          <td align="right">选择上传文件：</td>
          <td><input name="filename5" type="file" id="filename5" size="50"></td>
        </tr>-->
        <tr class="tdbg3">
          <td align="center">&nbsp; </td>
          <td><input type="submit" name="Submit" value="提  交">
            <input type="reset" name="Submit2" value="重  置"></td>
        </tr>
		</form>
    </table>
<% end sub %>
	</td>
  </tr>
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/user_ti.gif" width="800"></td>
  </tr>
</table>
</body>
</html>
