⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selimage.asp

📁 不错的ASP整站源代码。在IIS环境下运行都没有问题
💻 ASP
📖 第 1 页 / 共 2 页
字号:
                    value=textTop>文本上方</OPTION>
                    <OPTION 
                    value=absMiddle>绝对居中</OPTION>
                    <OPTION 
                    value=absBottom>绝对底部</OPTION>
                    <OPTION 
                    value=left>左对齐</OPTION>
                    <OPTION 
                    value=right>右对齐</OPTION>
                  </SELECT>
                </TD>
                <TD width="62">图像边框:</TD>
                <TD width="111"> 
                  <SELECT id=inpImgBorder name=inpImgBorder>
                    <OPTION 
                    value=0 selected>0</OPTION>
                    <OPTION value=1>1</OPTION>
                    <OPTION value=2>2</OPTION>
                    <OPTION value=3>3</OPTION>
                    <OPTION value=4>4</OPTION>
                    <OPTION value=5>5</OPTION>
                  </SELECT>
                  像素 </TD>
              </TR>
              <TR> 
                <TD width="66">图片宽度:</TD>
                <TD width="86"> 
                  <INPUT id=inpImgWidth size=2 name=inpImgWidth>
                  像素 </TD>
                <TD width="62">水平间距:</TD>
                <TD width="111"> 
                  <INPUT id=inpHSpace size=2 name=inpHSpace>
                  像素 </TD>
              </TR>
              <TR> 
                <TD width="66">图片高度:</TD>
                <TD width="86"> 
                  <INPUT id=inpImgHeight size=2 name=inpImgHeight>
                  像素 </TD>
                <TD width="62">垂直间距:</TD>
                <TD width="111"> 
                  <INPUT id=inpVSpace size=2 
            name=inpVSpace>
                  像素 </TD>
              </TR>
              </TBODY> 
            </TABLE>
          </TD>
        </TR>
        <TR> 
          <TD align=middle colSpan=2> 
            <TABLE cellSpacing=0 cellPadding=0 align=center>
              <TBODY> 
              <TR> 
                <TD><SPAN id=btnImgInsert style="DISPLAY: none"> 
                  <INPUT id=Button2 onclick=InsertImage();self.close(); type=button value='&nbsp;&nbsp;嵌入&nbsp;&nbsp;' name=Button2>
                  </SPAN><SPAN id=btnImgUpdate style="DISPLAY: none"> 
                  <INPUT id=Button3 onclick=UpdateImage();self.close(); type=button value='&nbsp;&nbsp;更新&nbsp;&nbsp;' name=Button3>
                  </SPAN></TD>
                <TD> 
                  <INPUT id=Button1 onclick=self.close(); type=button value='&nbsp;&nbsp;取消&nbsp;&nbsp;' name=Button1>
                </TD>
              </TR>
              </TBODY> 
            </TABLE>
          </TD>
        </TR>
        </TBODY> 
      </TABLE>
    </TD>
  </TR>
  </TBODY> 
</TABLE>
<SCRIPT language=JavaScript>
function GP_popupConfirmMsg(msg) { //v1.0-确认信息框
document.MM_returnValue = confirm(msg);}
function selectImage(sURL)
	{
	inpImgURL.value = sURL;
	
	divImg.style.visibility = "hidden"
	divImg.innerHTML = "<img id='idImg' src='" + sURL + "'>";
	

	var width = idImg.width
	var height = idImg.height 
	var resizedWidth = 150;
	var resizedHeight = 170;

	var Ratio1 = resizedWidth/resizedHeight;
	var Ratio2 = width/height;

	if(Ratio2 > Ratio1)
		{
		if(width*1>resizedWidth*1)
			idImg.width=resizedWidth;
		else
			idImg.width=width;
		}
	else
		{
		if(height*1>resizedHeight*1)
			idImg.height=resizedHeight;
		else
			idImg.height=height;
		}
	
	divImg.style.visibility = "visible"
	}

/***************************************************
	If you'd like to use your own Image Library :
	- use InsertImage() method to insert image
		Params : url,alt,align,border,width,height,hspace,vspace
	- use UpdateImage() method to update image
		Params : url,alt,align,border,width,height,hspace,vspace
	- use these methods to get selected image properties :
		imgSrc()
		imgAlt()
		imgAlign()
		imgBorder()
		imgWidth()
		imgHeight()
		imgHspace()
		imgVspace()
		
	Sample uses :
		window.opener.obj1.InsertImage(...[params]...)
		window.opener.obj1.UpdateImage(...[params]...)
		inpImgURL.value = window.opener.obj1.imgSrc()
	
	Note: obj1 is the editor object.
	We use window.opener since we access the object from the new opened window.
	If we implement more than 1 editor, we need to get first the current 
	active editor. This can be done using :
	
		oName=window.opener.oUtil.oName // return "obj1" (for example)
		obj = eval("window.opener."+oName) //get the editor object
		
	then we can use :
		obj.InsertImage(...[params]...)
		obj.UpdateImage(...[params]...)
		inpImgURL.value = obj.imgSrc()
		
***************************************************/	
function checkImage()
	{
	oName=window.opener.oUtil.oName
	obj = eval("window.opener."+oName)
	
	if (obj.imgSrc()!="") selectImage(obj.imgSrc())//preview image
	inpImgURL.value = obj.imgSrc()
	inpImgAlt.value = obj.imgAlt()
	inpImgAlign.value = obj.imgAlign()
	inpImgBorder.value = obj.imgBorder()
	inpImgWidth.value = obj.imgWidth()
	inpImgHeight.value = obj.imgHeight()
	inpHSpace.value = obj.imgHspace()
	inpVSpace.value = obj.imgVspace()

	if (obj.imgSrc()!="") //If image is selected 
		btnImgUpdate.style.display="block";
	else
		btnImgInsert.style.display="block";
	}
function UpdateImage()
	{
	oName=window.opener.oUtil.oName
	eval("window.opener."+oName).UpdateImage(inpImgURL.value,inpImgAlt.value,inpImgAlign.value,inpImgBorder.value,inpImgWidth.value,inpImgHeight.value,inpHSpace.value,inpVSpace.value);	
	}
function InsertImage()
	{
	oName=window.opener.oUtil.oName
	eval("window.opener."+oName).InsertImage(inpImgURL.value,inpImgAlt.value,inpImgAlign.value,inpImgBorder.value,inpImgWidth.value,inpImgHeight.value,inpHSpace.value,inpVSpace.value);
	}	
/***************************************************/
</SCRIPT>
<INPUT id=inpActiveEditor contentEditable=true style="DISPLAY: none" 
name=inpActiveEditor> </BODY></HTML>
<%case"delfile"'######################删除文件##########################%>
<% 
Dim Dfilepath
Dfilepath=Server.mappath(Trim(Request.QueryString("fname")))
Set fso = CreateObject("Scripting.FileSystemObject")
	if fso.FileExists(Dfilepath) then
	fso.DeleteFile(Dfilepath)
	end if
Set fso = nothing 
response.redirect ("selimage.asp?path="&Request.QueryString("path")) '操作成功转向的页面
%>
<%case"deldir"'######################删除文件夹##########################%>
<%
dim Ddir
Ddir = Server.mappath(Trim(Request.QueryString("dirname")))
Set fso = CreateObject("Scripting.FileSystemObject")
	if fso.FolderExists(Ddir) then
	fso.DeleteFolder(Ddir)
	end if
Set fso = nothing
response.redirect "selimage.asp" '操作成功转向的页面
%>
<%case"upload" '######################上传文件##########################%>
<!--#include FILE="../inc/upload_5xsoft.inc"-->
<%
set upload=new upload_5xsoft
set file=upload.file("file1")

'字符串比较的方法来获取文件类型,不知还有没有更好的方法解决这个问题。
function fileExpName(fileName)
dim tmpExp
tmpExp = InstrRev(fileName,".")
tmpExp = len(fileName) - tmpExp
fileName = right(fileName,tmpExp)
fileExpName = LCase(fileName)
end function 

formPath=upload.form("filepath")
fname = upload.form("fname")
Maxsize = 500' 文件大小,单位KB

Max_size = Maxsize * 1024 

if file.fileSize>0 then

file_Exp = fileExpName(file.FileName)
if file_Exp = "gif" or file_Exp = "jpg" then

Response.Write("<BODY bottomMargin=5 vLink=mediumslateblue aLink=mediumslateblue link=blue bgColor=#efeff7 leftMargin=10 topMargin=10>")
 if file.fileSize <= Max_size then
 file.saveAs Server.mappath(formPath&fname&"."&file_Exp)
 Response.Write("<meta http-equiv=""refresh"" content=""5;URL=selimage.asp?path="&formPath&""">")
 Response.Write("恭喜!成功上传文件<br>上传后的文件名为:&nbsp;&nbsp;<b>"&fname&"."&file_exp&"</b>")
 Response.Write("<br>5 妙钟后,自动转入上传文件所在的目录")
 Response.Write("<br><br>&nbsp;&nbsp;<a href=selimage.asp?path="&formPath&"&file="&fname&"."&file_exp&">"&"进入文件所在目录</a>")
 Response.Write("<br><br>&nbsp;&nbsp;<a href=""selimage.asp"">返回图像管理中心</a>")
 else
 Response.Write("上传文件不能大于 "&Maxsize&"KB")
 Response.Write("<br><a href=""selimage.asp"">返回重新上传</a>")
 end if
else
Response.Write("文件格式只能为gif或jpg")
end if
end if
set file=nothing
set upload=nothing
'response.redirect "selimage.asp" '操作成功转向的页面
%>
<% end select %>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -