vbs中namespace的用法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbs中namespace的用法相关的知识,希望对你有一定的参考价值。

Set objshell = CreateObject("Shell.Application")
Set objNS = objshell.namespace(&h2f)
Set colitems = objNS.items
For Each objitem In colitems
WScript.Echo objitem.name
Next

这里面的namespace的详细用法。objNS的所有属性!
Set objNS = objshell.namespace(&h2f)什么意思?

namespace的参数可以是表示各种路径的字符串,如"c:\\test"等;也可以是表示特殊路径的ShellSpecialFolderConstants,其值见此网页:

http://msdn.microsoft.com/en-us/library/bb774096(VS.85).aspx

关于objNS的属性,可以在vbsedit这个工具中一览无余:

参考技术A Shell.Application组件使用详解

1、创建 Shell 对象
var Shell = new ActiveXObject("Shell.Application");

2、使用 Shell 属性及方法

Shell.Application
Shell.Parent

Shell.CascadeWindows()
Shell.TileHorizontally()
Shell.TileVertically()
Shell.ControlPanelItem(sDir) /* 比如:sysdm.cpl */
Shell.EjectPC()
Shell.Explore(vDir)
Shell.Open(vDir)
Shell.FileRun()
Shell.FindComputer()
Shell.FindFiles()
Shell.Help()
Shell.MinimizeAll()
Shell.UndoMinimizeALL()
Shell.RefreshMenu()
Shell.SetTime()
Shell.TrayProperties()
Shell.ShutdownWindows()
Shell.Suspend()
oWindows = Shell.Windows() /* 返回ShellWindows对象 */
fFolder = Shell.NameSpace(vDir) /* 返回所打开的vDir的Folder对象 */
oFolder = Shell.BrowseForFolder(Hwnd, sTitle, iOptions [, vRootFolder]) /* 选择文件夹对话框 */
/*示例:
function BrowseFolder()

var Message = "清选择文件夹";

var Shell = new ActiveXObject( "Shell.Application" );
var Folder = Shell.BrowseForFolder(0,Message,0x0040,0x11);
if(Folder != null)

Folder = Folder.items(); // 返回 FolderItems 对象
Folder = Folder.item(); // 返回 Folderitem 对象
Folder = Folder.Path; // 返回路径
if(Folder.charAt(varFolder.length-1) != "\\")
Folder = varFolder + "\\";

return Folder;


*/

/*示例:
var Folder = Shell.NameSpace("C:\\"); // 返回 Folder对象
*/

3、使用 Folder 对象

[ oApplication = ] Folder.Application // Contains the Application object.
[ oParentFolder= ] Folder.ParentFolder // Contains the parent Folder object.
[ oTitle = ] Folder.Title // Contains the title of the folder.

Folder.CopyHere(vItem [, vOptions]) // Copies an item or items to a folder.
Folder.MoveHere(vItem [, vOptions]) // Moves an item or items to this folder.
/*
vItem: Required. Specifies the item or items to move. This can be a string that represents a file name, a FolderItem object, or a FolderItems object.
vOptions Optional. Specifies options for the move operation. This value can be zero or a
combination of the following values. These values are based upon flags defined for use with the
fFlags member of the C++ SHFILEOPSTRUCT structure. These flags are not defined as such for
Microsoft? Visual Basic?, Visual Basic Scripting Edition (VBScript), or Microsoft JScript?, so you
must define them yourself or use their numeric equivalents.
4 Do not display a progress dialog box.
8 Give the file being operated on a new name in a move, copy, or rename operation if a file with
the target name already exists.
16 Respond with "Yes to All" for any dialog box that is displayed.
64 Preserve undo information, if possible.
128 Perform the operation on files only if a wildcard file name (*.*) is specified.
256 Display a progress dialog box but do not show the file names.
512 Do not confirm the creation of a new directory if the operation requires one to be created.
1024 Do not display a user interface if an error occurs.
2048 Version 4.71. Do not copy the security attributes of the file.
4096 Only operate in the local directory. Don't operate recursively into subdirectories.
9182 Version 5.0. Do not move connected files as a group. Only move the specified files.
*/

Folder.NewFolder(bName) // Creates a new folder.
ppid = Folder.ParseName(bName) // Creates and returns a FolderItem object that represents a specified item.
/*
bName: Required. A string that specifies the name of the item.
*/

oFolderItems = Folder.Items() // Retrieves a FolderItems object that represents the collection of items in the folder.
sDetail = Folder.GetDetailsOf(vItem, iColumn) // Retrieves details about an item in a folder. For example, its size, type, or the time of its last modification.
/*
vItem: Required. Specifies the item for which to retrieve the information. This must be a FolderItem object.
iColumn: Required. An Integer value that specifies the information to be retrieved. The
information available for an item depends on the folder in which it is displayed. This value
corresponds to the zero-based column number that is displayed in a Shell view. For an item in the
file system, this can be one of the following values:0 Retrieves the name of the item.
1 Retrieves the size of the item.
2 Retrieves the type of the item.
3 Retrieves the date and time that the item was last modified.
4 Retrieves the attributes of the item.
-1 Retrieves the info tip information for the item.
*/

4、使用 FolderItems 对象

/*示例:
var FolderItems = Shell.NameSpace("C:\\").Items(); // 返回 FolderItems 对象
*/

[ oApplication = ] FolderItems.Application
[ iCount = ] FolderItems.Count
[ oParent = ] FolderItems.Parent

oFolderItem = FolderItems.Item([iIndex]) // 返回 FolderItem 对象

5、使用 FolderItem 对象

/*示例:
var FolderItem = Shell.NameSpace("C:\\").Items().Item(iIndex); // 返回 FolderItems 对象
*/

[ oApplication = ] FolderItem.Application
[ oParent = ] FolderItem.Parent
[ sName = ] FolderItem.Name(sName) [ = sName ]
[ sPath = ] FolderItem.Path
[ iSize = ] FolderItem.Size
[ sType = ] FolderItem.Type
[ bIsLink = ] FolderItem.IsLink
[ bIsFolder = ] FolderItem.IsFolder
[ bIsFileSystem = ] FolderItem.IsFileSystem
[ bIsBrowsable = ] FolderItem.IsBrowsable
[ oGetLink = ] FolderItem.GetLink // 返回 ShellLinkObject 对象
[ oGetFolder = ] FolderItem.GetFolder // 返回 Folder 对象
[ oModifyDate= ] FolderItem.ModifyDate(oModifyDate) [ = oModifyDate ] // Sets or retrieves the date and time that the item was last modified.

vVerb = FolderItem.Verbs() // 返回 FolderItemVerbs 对象. This object is the collection of verbs
that can be executed on the item.
FolderItem.InvokeVerb( [vVerb]) // Executes a verb on the item.

6、使用 FolderItemVerbs 对象

/*示例:
var FolderItem = Shell.NameSpace("C:\\").Items().Item(iIndex).Verbs(); // 返回 FolderItems 对象
*/

[ oApplication = ] FolderItemVerbs.Application
[ oParent = ] FolderItemVerbs.Parent
[ iCount = ] FolderItemVerbs.Count

oVerb = FolderItemVerbs.Item( [iIndex]) // 返回 FolderItemVerb 对象.

7、使用 FolderItemVerb 对象

/*示例:
var FolderItem = Shell.NameSpace("C:\\").Items().Item(iIndex).Verbs().Item(iIndex); // 返回 FolderItems 对象
*/

[ oApplication = ] FolderItemVerbs.Application
[ oParent = ] FolderItemVerbs.Parent
[ oName = ] FolderItemVerbs.Name

FolderItemVerb.DoIt() // Executes a verb on the FolderItem associated with the verb.

8、使用 ShellLinkObject 对象

[ sWorkingDirectory = ]ShellLinkObject.WorkingDirectory(sWorkingDirectory) [ = sWorkingDirectory ]
[ intShowCommand = ]ShellLinkObject.ShowCommand(intShowCommand) [ = intShowCommand ]
/*
intShowCommand Integer that specifies or receives the link's show state. This can be one of the
following values.
1 Activates and displays a window. If the window is minimized or maximized, the system restores
it to its original size and position.
2 Activates the window and displays it as a minimized window.
3 Activates the window and displays it as a maximized window.
*/
[ sArguments = ] ShellLinkObject.Arguments(sArguments) [ = sArguments ]
[ sDescription = ] ShellLinkObject.Description(sDescription) [ = sDescription ]
[ iHotkey = ] ShellLinkObject.Hotkey(iHotkey) [ = iHotkey ]
/*
iHotkey Integer that specifies or receives the link's hot key code. The virtual key code is in
the low-order byte, and the modifier flags are in the high-order byte. The modifier flags can be a
combination of the following values.
1 SHIFT key
2 CTRL key
4 ALT key
8 Extended key
*/
[ sPath = ] ShellLinkObject.Path(sPath) [ = sPath ]

iIcon = ShellLinkObject.GetIconLocation(sPath)
ShellLinkObject.Resolve(fFlags)
/*
fFlags Required. Flags that specify the action to be taken. This can be a combination of the following values.
1 Do not display a dialog box if the link cannot be resolved. When this flag is set, the high-
order word of fFlags specifies a time-out duration, in milliseconds. The method returns if the link
cannot be resolved within the time-out duration. If the high-order word is set to zero, the time-out
duration defaults to 3000 milliseconds (3 seconds).
4 If the link has changed, update its path and list of identifiers.
8 Do not update the link information.
16 Do not execute the search heuristics.
32 Do not use distributed link tracking.
64 Disable distributed link tracking. By default, distributed link tracking tracks removable
media across multiple devices based on the volume name. It also uses the Universal Naming Convention
(UNC) path to track remote file systems whose drive letter has changed. Setting this flag disables
both types of tracking.
128 Call the Microsoft? Windows? Installer.
*/
ShellLinkObject.Save( [sFile])
ShellLinkObject.SetIconLocation(sPath, iIndex)
/*
sPath Required. String value that contains the fully qualified path of the file that contains the icon.
iIndex Required. Integer that is set to the index of the icon in the file specified by sPath.
*/

9、使用 ShellWindows 对象
[ intCount = ] ShellWindows.Count

oShellWindows = ShellWindows._NewEnum() // Creates and returns a new ShellWindows object that is a copy of this ShellWindows object.
oFolder = ShellWindows.Item( [iIndex]) // Retrieves an InternetExplorer object that represents the Shell window.

10、说明
通过第一步创建 Shell 对象,并进行相关函数调用,就可以返回以上各种对象,并进行相关操作。
另外,在学习的过程中,发现了两个在msdn中提及却没相关的函数:
ShellApp.ShellExecute("cmd.exe");
ShellApp.NameSpace(vDir).Items().InvokeVerbEx(vVerb); /*vVerb:如delete*/

还有些特殊的用法:
//var myprinterfolder = Shell.NameSpace("shell:PrintersFolder");
//var mydocsfolder = Shell.NameSpace("shell:personal");
//var mycompfolder = Shell.NameSpace("shell:drivefolder");

//Shell.ShellExecute( "wiaacmgr.exe","/SelectDevice" );
//Shell.ShellExecute( "rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1" )
//Shell.ShellExecute( "rundll32.exe", "shell32.dll,Control_RunDLL netcpl.cpl,,1" );
//Shell.ShellExecute( "rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1" );

The following command will run Rundll32.exe.
Rundll32.exe <dllname>,<entrypoint>,<optional arguments>

The following code sample shows how to use the command.
Rundll32.exe Setupx.dll,InstallHinfSection 132 C:\Windows\Inf\Shell.inf

//Shell.ShowBrowserBar("C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1", true);

真不知道,没有公开的函数调用还有多少,而msdn给我们的使用的只是九牛一毛而已!

11、使用 Shell.UIHelper.1 对象

ShellUI = new ActiveXObject("Shell.UIHelper.1");

ShellUI.AddChannel(sURL)
ShellUI.AddFavorite(sURL [, vTitle])
bBool = ShellUI.IsSubscribed(sURL) // Indicates whether or not a URL is subscribed to.
ShellUI.AddDesktopComponent(sURL, sType [, Left] [, Top] [, Width] [, Height])
/*
sURL Required. A String value that specifies the URL of the new favorite item.
sType Required. A String value that specifies the type of item being added. This can be one of the following values:
image The component is an image.
website The component is a web site.

Left Optional. Specifies the position of the left edge of the component, in screen coordinates.
Top Optional. Specifies the position of the top edge of the component, in screen coordinates.
Width Optional. Specifies the width of the component, in screen units.
Height Optional. Specifies the height of the component, in screen units.
*/

Rundll 32.exe User.exe,ExitWindows

function FileSearch()

SearchAsst = new ActiveXObject("SearchAssistantOC.SearchAssistantOC");
SearchAsst.FindFilesOrFolders();
//ShellApp = new ActiveXObject("Shell.Application");
//ShellApp.ShowBrowserBar("C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1", true);
//与上效果相同


function PersonSearch()

SearchAsst = new ActiveXObject("SearchAssistantOC.SearchAssistantOC");
SearchAsst.FindPeople();


function ShellExecuteExe()

ShellApp = new ActiveXObject("Shell.Application");

//var myprinterfolder = shell.NameSpace("shell:PrintersFolder");
//var mydocsfolder = shell.NameSpace("shell:personal");
//var mycompfolder = shell.NameSpace("shell:drivefolder");

//ShellApp.ShowBrowserBar("C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1", true);

ShellApp.ShellExecute("cmd.exe");

//ShellApp.ShellExecute("wiaacmgr.exe","/SelectDevice");
//ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1")
//ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL netcpl.cpl,,1");
//ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1");

//对于FolderItems对象可以用InvokeVerbEx Method
//ShellApp.NameSpace("c:\\xxx").Items().InvokeVerbEx("delete");
//而通过InvokeVerb(x.Items().Item(0).Verbs().Item(i).Name);可以访问某个命令
// win = ShellApp.NameSpace("c:\\xxx").Items().Item(0)
// e = win.Verbs();
// for(i=0;i<e.Count;i++)
// document.writeln(e.Item(i).Name);
//
// win.InvokeVerb(e.Item(0).Name);


//=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
//
// BindToSA
//
// Bind to the specified url and return the cdo object for it.
//
function BindToSA(szURL)
var adModeRead = 1;
var oDoc = new ActiveXObject("CDO.KnowledgeStartAddress")
oDoc.DataSource.Open(szURL, null, adModeRead, -1, 0, "", "")
return oDoc;


//=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
//
// BindToUrl
//
// Bind to the specified url and return the cdo object for it.
//
function BindToUrl(szURL)
var adModeRead = 1;
var oDoc = new ActiveXObject("CDO.KnowledgeDocument")
oDoc.DataSource.Open(szURL, null, adModeRead, -1, 0, "", "")
return oDoc;


function Msg(str)
//<object id=FolderControl classid="clsid:787e8fd0-7ad6-11d3-83da-00c04f505f43" style="position: absolute; left: 0px; top: 0px; visibility: hidden;">
//var FolderControl = new ActiveXObject("Tahoe.FolderControl");
FolderControl.TraceMsg(str);


ShellApp = new ActiveXObject("Shell.Application");
//ShellApp.ShowBrowserBar("C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1", true);

//ShellApp.ShellExecute("Rundll32.exe","shell32.dll,SHCreateLocalServerRunDll 601ac3dc-786a-4eb0-bf40-ee3521e70bfb");

//ShellApp.ShellExecute("Rundll32.exe","shdocvw.dll,OpenURL");//Internet 快捷方式
//ShellApp.ShellExecute("Rundll32.exe","msconf.dll,OpenConfLink");//SpeedDial
//ShellApp.ShellExecute("Rundll32.exe","zipfldr.dll,RouteTheCall");//压缩文件夹shdocvw.dll,OpenURL
//ShellApp.ShellExecute("Rundll32.exe","netplwiz.dll,UsersRunDll");//用户帐户
//ShellApp.ShellExecute("Rundll32.exe","shell32.dll,Options_RunDLL 0");//文件夹选项
//ShellApp.ShellExecute("Rundll32.exe","shell32.dll,Options_RunDLL 1");//显示任务栏和开始菜单

//ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1")appwiz.cpl,NewLinkHere
//ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLLAsUser")

//ShellUI = new ActiveXObject("Shell.UIHelper.1");
//ShellUI.AddFavorite("http://www.microsoft.com/msdn","MSDN")
//ShellUI.AddChannel("http://www.microsoft.com/")

ShellApp.ShellExecute("c:\\windows\\system32\\mshta.exe","C:\\xx.hta")

//var s = ShellApp.ShellExecute("rundll32.exe", "kernel32.dll,GetVersionExA"+","+so);

/*var p = "C:\\"
sha = new ActiveXObject("Shell.Application");
var g = sha.NameSpace(p).Items().Item("xxx");
var v = g.Verbs();
var str=null;
for(i=0;i<v.Count;i++)
str = v.item(i).Name;
if(str.search("重命名")!=-1)break;
str = null

if(str)
g.InvokeVerbEx(str,"c:\\xx");
else
alert('no')
//g.InvokeVerbEx("重命名","xx");
*/本回答被提问者采纳

VBS脚本编程——对象的创建与调用

对象:严格的说,对象是复杂数据和程序结构在内存中的表现,只有在程序运行时才存在。包含有方法和属性。

对象的创建及用法

1. Set 语句

将对象引用赋给一个变量或属性,或者将对象引用与事件关联。
Set objectvar = {objectexpression | New classname | Nothing}
-或者-
Set object.eventname = GetRef(procname)
 
参数
objectvar
必选项,变量或属性名称;符合标准变量命名规则。
objectexpression
可选项,与对象名称一致的表达式,另一个相同对象类型、函数或方法的已声明变量,它们返回相同对象类型的对象。
New
用于创建一个类的新实例的关键字。如果 objectvar 包含一个对某个对象的引用,当一个新的引用被赋给这个对象之后,则这个引用将被释放。New 关键仅用于创建一个类的实例。
classname
可选项. 创建的类名称。使用 Class 语句定义类及其语句。
Nothing
可选项。断开 objectvar 与任何指定对象或类的关联。当没有其他变量引用前面的引用对象时,将 objectvar 赋值为 Nothing 以释放与前面的引用对象相关联的系统或内存资源。
object
必选项。与 event 相关联的对象名称。
event
必选项。函数作用域的事件名称。
procname
必选项。包含与event 相关联的 SubFunction 名称的字符串。
 
说明
为了使其有效,objectvar 必须与赋值的对象类型相一致。
DimPrivatePublicReDim 语句仅声明一个引用对象的变量。在使用. Set 语句为一个具体对象赋值之前,没有实际对象可以引用。
通常, 当您使用 Set 语句将一个对象引用赋给一个变量之前,不会创建那个变量的对象的副本。实际上,只创建了一个对象的引用。多个引用对象变量可以引用相同的对象。因为这些变量都是对象的引用,而不是对对象副本的引用,因此对象中所作的任何变化都可以在引用该对象的所有变量中反映出来。
利用 New 关键字,您可以随时创建一个类的实例,并将一个对象引用变量赋值给它。赋给类的实例的变量一定利用 Dim (或相似的语句)语句事先已经声明。
 

2. CreateObject 函数

创建并返回对 Automation 对象的引用。
CreateObject(servername.typename [, location])
参数
servername
必选项。提供对象的应用程序名称。
typename
必选项。要创建的对象类型或类。
location
可选项。对象所在的网络服务器将被创建。
 
说明
Automation 服务器至少提供一种对象类型。例如,字处理应用程序可以提供应用程序对象、文档对象和工具条对象。
要创建 Automation 对象,将 CreateObject 函数返回的对象赋值给某对象变量
举例,创建Excel表格对象:
Dim ExcelSheet
    Set ExcelSheet = CreateObject("Excel.Sheet")
\' 上述代码启动创建对象(在此实例中,是 Microsoft Excel 电子表格)的应用程序。
\' 对象创建后,就可以在代码中使用定义的对象变量引用此对象。
\' 在下面的示例中,可使用对象变量、ExcelSheet 和其他 Excel 对象,包括 Application 对象和 Cells 集合访问新对象的属性和方法。
\' 例如:
	\' 使 Excel 在整个 Application 对象中都可见。
	ExcelSheet.Application.Visible = True
	\' 将一些文本放入工作表的第一个单元格中。
	ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1"
	\' 保存工作表。
	ExcelSheet.SaveAs "C:\\DOCS\\TEST.XLS"
	\' 关闭 Excel,使 Quit 方法处于 Application 对象中。
	ExcelSheet.Application.Quit
	\' 释放对象变量。
	Set ExcelSheet = Nothing
在远程服务器上创建一个对象,当 Internet 安全关闭时只能完成。通过传递计算机名到 CreateObject 服务器名的参数,能在远程网络上创建对象。该名称如同共享部份的机器名。例如网络共享名命名为: "\\\\myserver\\public", servername 是 "myserver"。另外,只能指定 servername 使用 DNS 格式或 IP 地址。
 

3. GetObject 函数

返回对文件中 Automation 对象的引用。
GetObject([pathname] [, class])
参数
Pathname
可选项。字符串,包含待检索对象的文件的完整路径和名称。如果省略 pathname 则必须有 class
Class
可选项。字符串,对象的类。
 
class 参数的语法格式为 appname.objectype,其中包括以下部分:
参数
appname
必选项。字符串,提供对象的应用程序名称。
objectype
必选项。字符串,要创建的对象的类型或类。
 
说明
使用 GetObject 函数可以访问文件中的 Automation 对象,而且可以将该对象赋值给对象变量。使用 Set 语句将 GetObject 返回的对象赋值给对象变量。
 

常用的VBS调用对象

  • 文件系统对象相关: ("scripting.filesystemobject")
  • 字典相关: ("scripting.dictionary")
  • 脚本外壳相关: ("wscript.shell")
  • windows外壳相关: ("shell.application")
  • 正则表达式相关: ("vbscript.regexp")
  • asp相关: ("mswc.adrotator") ("mswc.nextlink") ("mswc.myinfo")
  • 公用对话框相关: ("mscomdlg.commondialog")
  • 编码与密码相关: ("scriptpw.password") ("scripting.encoder")
  • 邮件发送的组件相关: ("jmail.message") ("cdonts.newmail") ("cdo.configuration") ("eudora.euapplication.1") ("novellgroupwaresession")
  • 水晶报表相关: ("crystalruntime.application")
  • ie浏览器相关: ("internetexplorer.application")
  • windows媒体播放相关: ("wmplayer.ocx") ("wmplayer.ocx.7")
  • 助手角色相关: ("agent.control")
  • ado相关: ("adodb.connection") ("adodb.command") ("adodb.recordset") ("adodb.record") ("adodb.stream") ("dao.dbengine.35") ("adox.catalog") ("adox.table")
  • sql相关: ("sqldmo.sqlserver") ("sqldmo.login") ("sqldmo.backup") ("sqldmo.user") ("sqldmo.backupdevice") ("sqldmo.database") ("sqldmo.restore") ("sqldmo.application") office相关: ("word.application") ("excel.application") ("powerpoint.application") ("excel.sheet") ("frontpage.application") ("access.application") ("msgraph.application") ("outlook.application")
  • 图像图形相关: ("aspimage.jpeg") ("persits.jpeg") ("activeimage.images.1")("jsdraw.ops") ("jsiptc.jpgedit") ("gflax.gflax") ("photoshop.application")
  • 语音朗读相关: ("speech.voicetext") ("speech.voicetext.1") ("sapi.spvoice") ("sapi.spfilestream") ("texttospeech.texttospeech") ("texttospeech.texttospeech.1") ("activevoice.activevoice") ("activevoice.activevoice.1")
  • 操作系统相关: ("jsdlgbox.browser") ("jsbin.binaryops") ("jsform.window") ("jslistvw.list") ("jssys3.ops") ("jssys3.iniedit") ("tli.tliapplication") ("autoitx3.control") ("windowsinstaller.installer") ("virtualserver.application") ("useraccounts.commondialog") ("mosearch.gatherlog.1") ("mscomdlg.commondialog")
  • wmi相关: ("wbemscripting.swbemdatetime") ("wbemscripting.swbemlocator") ("wbemscripting.swbemnamedvalueset") ("wbemscripting.swbemsink","sink_")("wbemscripting.swbemrefresher") ("wbemscripting.swbemlasterror") ("wbemscripting.swbemobjectpath")
  • web,net相关: ("winhttp.winhttprequest") ("winhttp.winhttprequest.5.1") ("msxml2.serverxmlhttp") ("microsoft.xmlhttp") ("microsoft.xmldom") ("msxml2.xmlhttp.4.0") ("wscript.network") ("asphttp.conn") ("inetctls.inet") ("post.clspost") ("webget.web") ("netcommocx.netcomm","com_")("mswinsock.winsock") ("rcbdyctl.setting") 

以上是关于vbs中namespace的用法的主要内容,如果未能解决你的问题,请参考以下文章

namespace基础介绍

extern 与 namespace 的用法

C++中namespace和class

PHP命令空间namespace及use的用法实践总结

Linux Namespace : 简介

using namespace ;是启用一个命名空间。有没有结束用一个命名空间的办法呢?