惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
N
Netflix TechBlog - Medium
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
G
Google Developers Blog
罗磊的独立博客
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
A
About on SuperTechFans
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
GbyAI
GbyAI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
The Register - Security
The Register - Security
U
Unit 42
D
Docker
Martin Fowler
Martin Fowler
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
阮一峰的网络日志
阮一峰的网络日志
C
Cybersecurity and Infrastructure Security Agency CISA
博客园_首页
Google DeepMind News
Google DeepMind News

博客园 - a11s.net

深受打击-MDX这次更新没有了! - a11s.net - 博客园 [提问][收集线索]关于MMC - a11s.net - 博客园 进度记录 记录一下,对于rss还有些迷茫 前两天搞的东西 脚本加密变形工具 - a11s.net - 博客园 前两天搞的东西 象棋棋谱字符转换 Microsoft Scripting Runtime Black-Cat 阶段性报告 N9没更新了,QQ都改名叫N9了 似乎有耽误进度了 光盘放进去之后自动运行 数据库存储2 游戏控制管理器(a11s) [zt]扫盲,什么叫MAD(a11s) 动态动画脚本(a11s) 游戏文件系统(a11s) 还是想法,半即时RPG战斗模式(网络或者单机)(a11s) 先换一个,等新的logo来了再换回来... 扫描之后,如何添加到数据库
Microsoft Scriptlet 原来是这个东西啊
a11s.net · 2007-01-25 · via 博客园 - a11s.net

好久没有更新了.今天发现了一个小东西,怕以后忘掉,特此记录一下.

本来想给自己的字符串批量替换工具 添加脚本支持.添加引用的时候发现了Scriptlet. 也就听说过java有applet serverlet 这个windows 下面的 scriptlet是什么东西.说不定能拿来为我所用.

查阅了一些资料.大体明白了.主要是用于 IIS的.
按照微软示例的解释.我们想要给asp提供支持.通常都是自己用vb vc写com对象.比如activeDLL 之类.用了scriptlet,我们可以用脚本写com对象,给asp提供支持.或者任何其他用com的东西.而且也要自己注册classid之类的东西(vb6运行的时候自动注册,或者可以regsvr32注册,但是这个东西好像....)

看起来,还是我们调用脚本.而且还多了一层.程序用起来的时候还要添加引用.不如直接调用方便.很鸡肋的感觉.也许是为了方便服务器管理员??他们用脚本何必到COM这一层?别人谁会用你的脚本?自己用为何不直接创建activedll?只能理解为,这个东西是可以随时编辑不需要像dll更新那么麻烦.(但是我还是不能理解,固定化的exe就算调用变化的东西也可以直接用脚本不需要经过com啊).

算了.直接看微软的示例吧

Title

概要

Microsoft Windows 脚本组件允许开发人员编写 COM 组件, 称为 Scriptlets Scriptlets , 用 VBScript 或 JavaScript 等语言。 然后从任何 COM 兼容编程环境, 如 MicrosoftVisualC++、 VisualBasic 或 Active Server 页 (ASP) 调用这些组件。

Title
1. 复制以下代码并保存为 " Example.sct " 桌面上:
<SCRIPTLET>
            <REGISTRATION
            Description="DHTML Button Scriplet"
            ProgID="DHTML.Button.Scriptlet"
            Version="1.0" >
            </REGISTRATION>
            <IMPLEMENTS ID="Automation" TYPE="Automation">
            <METHOD NAME="CreateButton">
            <PARAMETER NAME="txt"/>
            <PARAMETER NAME="url"/>
            <PARAMETER NAME="fore"/>
            <PARAMETER NAME="back"/>
            <PARAMETER NAME="glow"/>
            <PARAMETER NAME="width"/>
            </METHOD>
            </IMPLEMENTS>
            <SCRIPT LANGUAGE="VBScript">
            Option Explicit
            Function CreateButton(txt,url,fore,back,glow,width)
            Dim strNormal
            Dim strGlow
            strNormal = "this.style.background='" & back & "';"
            strGlow   = "this.style.background='" & glow & "';"
            CreateButton = vbCrLf & "<table border=""0""
            cellpadding=""5"">" & vbCrLf
            CreateButton = CreateButton & "<tr><td align=""center"""
            CreateButton = CreateButton & " language=""JavaScript""" &
            vbCrLf
            If width <> "" Then
            CreateButton = CreateButton & " width=""" & width & """"
            End If
            CreateButton = CreateButton & " style=""background:""" & back
            & ";"
            CreateButton = CreateButton & "color:" & fore & ";""" &
            vbCrLf
            CreateButton = CreateButton & " onMouseover=""" & strGlow &
            """" & vbCrLf
            CreateButton = CreateButton & " onMouseout=""" & strNormal &
            """>" & vbCrLf
            CreateButton = CreateButton & "<a href=""" & url & """"
            CreateButton = CreateButton & " style=""text-decoration:none;"""
            CreateButton = CreateButton & "color:" & fore & "";"">" &
            vbCrLf
            CreateButton = CreateButton & txt & "</a></td></tr>" &
            vbCrLf
            CreateButton = CreateButton & "</table>" & vbCrLf
            End Function
            </SCRIPT>
            </SCRIPTLET>
            
备注:
 
注册 节中 ProgID 字段引用 ID scriptlet 的类。
注册 scriptlet, 后注册表在以下位置中创建项对于类 ProgID 和 CLSID:
HKEY_CLASSES_ROOT\DHTML.Button.Scriptlet
                                    HKEY_CLASSES_ROOT\DHTML.Button.Scriptlet\CLSID
                                    
使用 CLSID 默认值, 可获取类 GUID, 可用于生成路径以下列两项:
HKEY_CLASSES_ROOT\CLSID\{class GUID goes here}\InprocServer32
                                    HKEY_CLASSES_ROOT\CLSID\{class GUID goes here}\ScriptletURL
                                    
这些两项很中获取下列疑难解答信息尤其有用:

InprocServer 32 = 处理程序 DLL (例如 Scrobj.dll): 路径
ScriptletURL = scriptlet 路径:

2. 右击 scriptlet 选择 注册 , 并再单击对于确认对话框 确定 。
3. 在 IIS 计算机上保存以下 ASP 代码作为 " Example.asp " Web 文件夹中: 与启用 脚本访问
<%@LANGUAGE="VBSCRIPT"%>
            <% Option Explicit %>
            <html>
            <body>
            <%
            Dim objButton
            Set objButton = Server.CreateObject("DHTML.Button.Scriptlet")
            Response.Write objButton.CreateButton("Back to
            Home","/","white","black","#0000ff","100")
            Response.Write
            objButton.CreateButton("Microsoft","http://www.microsoft.com","#ff
            ff00","magenta","#33cc33","100")
            Response.Write
            objButton.CreateButton("MSDN","http://msdn.microsoft.com","black",
            "red","brown","100")
            %>
            </body>
            </html>
            
4. 当浏览示例页, 应看到三 DHTML 悬停按钮。

posted on 2007-01-25 10:22  a11s.net  阅读(3201)  评论()    收藏  举报