易截截图软件、单文件、免安装、纯绿色、仅160KB

VB程序中使用脚本支持

 正在开发小秘书系统并不断提高其智能水平,其中用到的是脚本支持的技术
虽然这部分不属于初学者使用,然而有些人想学这个东东,这里就发~~~布出去吧!
新建一个标准exe工程(Standard EXE);
"工程"(Project)-->"部件"(Components)
选定"Microsoft Script Control 1.0" ,位置是C:\WINDOWS\system32\msscript.ocx
添加控件到工程,个人爱好我命名mscScript
然后添加一些控件,得到如下图的界面,然后是下面这些函数,过程:
Private Sub Form_Load()
 mscScript.AddObject "frmMain", frmMain
 mscScript.AddObject "objScript", objScript
End Sub
'---------------------------------------
'vbClass Moudle clsFunction
'---------------------------------------
Public Function strRun(ByVal str As String) As String
 Dim strName As String
 Dim strExpress() As String
 strName = Left(str, InStr(str, " ") - 1)
 strExpress = Split(Mid(str, InStr(str, " ") + 1), ",")
 strRun = CStr(frmMain.mscScript.Run(strName, strExpress(0), strExpress(1)))
End Function
需要注意是类模块要生成对象:Public objScript As New clsFunction,这个知识在一般程序开发下很少接触;
然后就是vbScript(脚本)和Visual Basic的区别,前者是后者的子集,语法上不能混乱
最常见的错误是:vbscript的变量只有Variant类型,Next 后面不跟变量名等...
源代码在我的资源那里有,
http://prsniper.download.csdn.net/user/prsniper/all/1
希望更多的人学好编程,不断提高技术,深度的探讨可以加我QQ:627666017
空间只面向新手,,,


相关文档:

浅谈VB编程中网格控件的选用及使用方法

 内容提要摘要: The software of visual basic developed by Microsoft corporation is becoming one of the main develop tools at today。 As it's remarkable peculiarity, the Grid control has very great practical and active use。 This topic discusses how to use the grid control of VB to develop prati ......

vb调用excel方法大全

在VB中要想调用Excel,需要打开VB编程环境“工程”菜单中的“引用”项目,并选取项目中的“Microsoft Excel 11.0 object library”项。由于你的Excel版本不同,所以这个选项的版本号也是不同的。
    因为EXCEL是以层次结构组织对象的,其对象模型中含有许多不同的对象元素。
&n ......

asp vb.net 在线统计 简单版本 和精确版本

 简单
在Global.asa文件中加入如下的代码:
Java代码
1. <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
2.
3. Sub Application_OnStart
4.
5. '当服务器开启时,设置在线用户计数器为0
6. Application("ActiveUsers") = 0
7.
......

VB: 一个正则提取功能

'引用:Microfoft VBScript Regular Expressions 5.5 '一个正则提取功能
Public Function regGetStr_three(ByVal myString As String, ByVal patReg As String) As String()
   Dim objRegExp As RegExp
   Dim objMatch As Match
   Dim colMatches   As Ma ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号