| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 498 人关注过本帖
标题:编辑器里的代码为什么是这样,高手请帮帮忙
取消只看楼主 加入收藏
nancy26300
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2010-2-15
结帖率:0
收藏
 问题点数:0 回复次数:0 
编辑器里的代码为什么是这样,高手请帮帮忙
这是上传视频的文件,这里的;일之类的文字是怎么做成的,哪位高手给我解释解释,谢谢!


<%
Dim abc
Set abc = Server.CreateObject("ABCUpload4.XForm")
abc.AbsolutePath = True
abc.codepage = "65001"

Dim gbn : gbn = abc.item("gbn")

if replace(gbn," ","") = "up" then

Dim perioArry,imgDot,DirectoryPath,webPath
DirectoryPath = Server.MapPath("..") & "\pds_update\"
webPath = "../pds_update/"

Dim objSajin,errorNum
errorNum = 0

Set objSajin = abc("upimage")(1)
if objSajin.FileExists then
    if objSajin.Length < (1024 * 1024 * 10)  then
        perioArry = Split(objSajin.SafeFileName,".")
        imgDot = perioArry(Ubound(perioArry))
        if LCase(imgDot) = "wmv" or LCase(imgDot) = "avi" or Lcase(imgDot) = "swf" then
            sajin = "img_" & svdatefomt & "." & imgDot
            objSajin.Save DirectoryPath & sajin
        else
            errorNum = 3
        end if
    else
        errorNum = 2
    end if
else
    errorNum = 1
end if
Set objSajin = Nothing

Function svdatefomt()
    Dim dt1,dt2,dt3
    dt1 = replace(Date,"-","")
    dt2 = FormatDateTime(now(),4)
    dt3 = second(now)
    dt1 = Right(dt1,8)
    dt2 = replace(dt2,":","")

    if dt3 < 10 then
        dt3 = "0" & dt3
    end if
svdatefomt = dt1 & dt2 & dt3
End Function
%>
<html>
<head><% if errorNum < 1 then
iwidth = abc.item("width")
iheight = abc.item("height")


dim imgsrc : imgsrc = "<embed src=" & webPath & sajin & " width=" & iwidth & " height=" & iheight & "></embed>"  %>
<script type="text/javascript">
<!--
var opener = window.dialogArguments;
opener.easyUtil._editor.innerHTML('<%=imgsrc%>');
self.close();
//-->
</script>
</head>
<body><% else %>
<style>
body {
    background: threedface;
    color: windowtext;
    margin: 10px;
    border-style: none;
    font:9pt 돋움;
    text-align:center;
}
body, button, div, input, select, td, legend { font:9pt 돋움; }
input,select {color:highlight}
button {width:80px;}
fieldset { margin-bottom:5px;text-align:left;padding:5px }
</style>
</head>
<body>
    <fieldset>
    <legend>Error</legend>
    <table border=0 cellspacing=6 cellpadding=0>
    <tr height="50">
    <td><% select case errorNum
    case 1 %>
    파일전송이 잘못되었습니다!<% case 2 %>
    파일 용량은 10Mb를 초과할 수 없습니다. <% case 3 %>
    허용되지 않는 파일 입니다.<% end select %>
    </td>
    </tr>
    </table>
    </fieldset>
    <button onClick="self.close();">확인</button>
<% end if %>
</body>
</html>
<% else %>
<html>
<head>
<style>
body {
    background: threedface;
    color: windowtext;
    margin: 10px;
    border-style: none;
    font:9pt 돋움;
    text-align:center;
}
body, button, div, input, select, td, legend { font:9pt 돋움; }
input,select {color:highlight}
button {width:80px;}
fieldset { margin-bottom:5px;text-align:left;padding:5px }

</style>
<script type="text/javascript">
<!--
function insertImage()
{
    var f=document.tform;
    var src = f.upimage.value;
    if(!src){alert("동영상파일을 첨부 해주세요!"); return; }
    if(!src.match(/\.(avi|wmv|swf)$/i)) { alert("동영상 파일인지 확인해주세요!!"); f.upimage.select(); return; }

    var w = f.width.value;
    if(!w){
        alert("가로 크기를 지정해주세요");
        f.w.focus();
        return;
    }

    var h = f.height.value;
    if(!h){
        alert("세로 크기를 지정해주세요");
        f.h.focus();
        return
    }
    f.submit();
}

function NumKeyOnly(){
    if((event.keyCode<48)||(event.keyCode>57)) event.returnValue=false;
}
//-->
</script>
</head>

<body scroll="no">
<form action="upmovie.asp" name="tform" method="post" enctype="multipart/form-data">
<input type="hidden" name="gbn" value="up">
    <fieldset>
    <legend>동영상 선택</legend>
    <input type="file" name="upimage" style="width:100%" />
    </fieldset>

    <fieldset>
    <legend>옵션</legend>
    <table border=0 cellspacing=6 cellpadding=0>
    <tr>
    <td>가로*세로</td>
    <td>
    <input type="text" name="width" size="3" maxlength=3 style="ime-mode:disabled;" onFocus="this.select();" onKeyPress="NumKeyOnly();"> *
    <input type="text" name="height" size="3" maxlength=3 style="ime-mode:disabled;" onFocus="this.select();" onKeyPress="NumKeyOnly();">px
    </td>
    </tr>
    </table>
    </fieldset>

    <button onClick="insertImage()">확인</button>

    <button onClick="self.close();">취소</button>

</form>
</body>
</html><% end if %>

搜索更多相关主题的帖子: 代码 编辑器 
2010-02-26 09:16
快速回复:编辑器里的代码为什么是这样,高手请帮帮忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039015 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved