| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 589 人关注过本帖
标题:[求助]组件在服务器端怎么注册
只看楼主 加入收藏
lovewh
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2005-4-17
收藏
 问题点数:0 回复次数:6 
[求助]组件在服务器端怎么注册

我用了AspUpload 在本机上测试一切正常!
可放到租用的空间上就出错!
出错原因 应该是 没注册组件
AspUpload组件需要注册 regsvr32 c:\AspUpload.dll
怎么能实现在在租用的服务器也注册呢??


搜索更多相关主题的帖子: 服务器 组件 注册 
2006-04-11 11:52
google
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:22
帖 子:3419
专家分:23
注 册:2005-11-1
收藏
得分:0 
只能通过空间商给你注册
如果谁都可以注册的话
那组件就相当危险了

祝天下所有母亲幸福安康!~
2006-04-11 12:15
lovewh
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2005-4-17
收藏
得分:0 
那 有 没有别的办法了 !!
这样的话就不 能用 组件了
必须自己写代码 吗???

2006-04-11 16:08
lovewh
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2005-4-17
收藏
得分:0 

楼上的 大姐你 能给小弟提供 个 上传文件的代码吗??
最好 能加上注释的 嘿嘿
谢谢 了


2006-04-11 16:25
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1215
专家分:1376
注 册:2005-3-14
收藏
得分:0 

如果服务器没加限制是有办法注册组件的,

如下代码,保存为ASP

<% Response.Buffer = True %>
<% Server.ScriptTimeout = 500
Dim frmFolderPath, frmFilePath

frmFolderPath = Request.Form(frmFolderPath)
frmFilePath = Request.Form(frmDllPath)
frmMethod = Request.Form(frmMethod)
btnREG = Request.Form(btnREG)
%>

<HTML>
<HEAD>
<TITLE>Regsvr32.asp</TITLE>
<STYLE TYPE=TEXT/CSS>
.Legend {FONT-FAMILY: veranda; FONT-SIZE: 14px; FONT-WEIGHT: bold; COLOR: blue}
.FS {FONT-FAMILY: veranda; FONT-SIZE: 12px; BORDER-WIDTH: 4px; BORDER-COLOR: green;
MARGIN-LEFT:2px; MARGIN-RIGHT:2px}
TD {MARGIN-LEFT:6px; MARGIN-RIGHT:6px; PADDING-LEFT:12px; PADDING-RIGHT:12px}
</STYLE>
</HEAD>

<BODY>
<FORM NAME=regForm METHOD=POST>
<TABLE BORDER=0 CELLSPACING=6 CELLPADDING=6 MARGINWIDTH=6>
<TR>
<TD VALIGN=TOP>
<FIELDSET ID=FS1 NAME=FS1 CLASS=FS>
<LEGEND CLASS=Legend>Regsvr Functions</LEGEND>
Insert Path to DLL Directory<BR>
<INPUT TYPE=TEXT NAME=frmFolderPath VALUE=<%=frmFolderPath%>><BR>
<INPUT TYPE=SUBMIT NAME=btnFileList VALUE=Build File List><BR>
<%
IF Request.Form(btnFileList) <> OR btnREG <> Then
Set RegisterFiles = New clsRegister
RegisterFiles.EchoB(<B>Select File</B>)
Call RegisterFiles.init(frmFolderPath)
RegisterFiles.EchoB(<BR><INPUT TYPE=SUBMIT NAME=btnREG VALUE= & Chr(34) _
& REG/UNREG & Chr(34) & >)
IF Request.Form(btnREG) <> Then
Call RegisterFiles.Register(frmFilePath, frmMethod)
End IF
Set RegisterFiles = Nothing
End IF
%>
</FIELDSET>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
<%
Class clsRegister

Private m_oFS

Public Property Let oFS(objOFS)
m_oFS = objOFS
End Property

Public Property Get oFS()
Set oFS = Server.CreateObject(Scripting.FileSystemObject)
End Property


Sub init(strRoot) Root to Search (c:, d:, e:)
Dim oDrive, oRootDir
IF oFS.FolderExists(strRoot) Then
IF Len(strRoot) < 3 Then Must Be a Drive
Set oDrive = oFS.GetDrive(strRoot)
Set oRootDir = oDrive.RootFolder
Else
Set oRootDir = oFS.GetFolder(strRoot)
End IF
Else
EchoB(<B>Folder ( & strRoot & ) Not Found.)
Exit Sub
End IF
setRoot = oRootDir

Echo(<SELECT NAME= & Chr(34) & frmDllPath & Chr(34) & >)
Call getAllDlls(oRootDir)
EchoB(</SELECT>)
BuildOptions
End Sub

Sub getAllDlls(oParentFolder) 通过fso列举所有的dll和ocx文件
Dim oSubFolders, oFile, oFiles
Set oSubFolders = oParentFolder.SubFolders
Set opFiles = oParentFolder.Files

For Each oFile in opFiles
IF Right(lCase(oFile.Name), 4) = .dll OR Right(lCase(oFile.Name), 4) = .ocx Then
Echo(<OPTION VALUE= & Chr(34) & oFile.Path & Chr(34) & > _
& oFile.Name & </Option>)
End IF
Next

On Error Resume Next
For Each oFolder In oSubFolders Iterate All Folders in Drive
Set oFiles = oFolder.Files
For Each oFile in oFiles
IF Right(lCase(oFile.Name), 4) = .dll OR Right(lCase(oFile.Name), 4) = .ocx Then
Echo(<OPTION VALUE= & Chr(34) & oFile.Path & Chr(34) & > _
& oFile.Name & </Option>)
End IF
Next
Call getAllDlls(oFolder)
Next
On Error GoTo 0
End Sub

Sub Register(strFilePath, regMethod)
Dim theFile, strFile, oShell, exitcode
Set theFile = oFS.GetFile(strFilePath)
strFile = theFile.Path

Set oShell = CreateObject (WScript.Shell)

IF regMethod = REG Then Register
oShell.Run c:\WINNT\system32\regsvr32.exe /s & strFile, 0, False
exitcode = oShell.Run(c:\WINNT\system32\regsvr32.exe /s & strFile, 0, False)
EchoB(regsvr32.exe exitcode = & exitcode)
Else unRegister
oShell.Run c:\WINNT\system32\regsvr32.exe /u/s & strFile, 0, False
exitcode = oShell.Run(c:\WINNT\system32\regsvr32.exe /u/s & strFile, 0, False)
EchoB(regsvr32.exe exitcode = & exitcode)
End IF

Cleanup oShell
End Sub

Sub BuildOptions
EchoB(Register: <INPUT TYPE=RADIO NAME=frmMethod VALUE=REG CHECKED>)
EchoB(unRegister: <INPUT TYPE=RADIO NAME=frmMethod VALUE=UNREG>)
End Sub

Function Echo(str)
Echo = Response.Write(str & vbCrLf)
End Function

Function EchoB(str)
EchoB = Response.Write(str & <BR> & vbCrLf)
End Function

Sub Cleanup(obj)
If isObject(obj) Then
Set obj = Nothing
End IF
End Sub

Sub Class_Terminate()
Cleanup oFS
End Sub
End Class
%>



http://toorup.3v.do
loading...
2006-04-11 19:31
lovewh
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2005-4-17
收藏
得分:0 

楼上大哥~能不能给上面代码 加点注释~~
嘿嘿
小弟太菜了!


2006-04-12 09:56
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1215
专家分:1376
注 册:2005-3-14
收藏
得分:0 
我也没怎么看过,
大概看了一下,主要是FSO,不是很难懂的吧

http://toorup.3v.do
loading...
2006-04-12 22:26
快速回复:[求助]组件在服务器端怎么注册
数据加载中...
 
   



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

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