在VB中如何访问到远端服务器,只看到vb.net、C#和C++的例子,VB如何调用呢?

来源:互联网 发布:fc2手机视频域名2017 编辑:程序博客网 时间:2024/05/21 16:43

在VB中如何访问到远端服务器,只看到vb.net、C#和C++的例子,VB如何调用呢?

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Dim tServerType As Type
Dim RemoteServer As WMSServer

Try

??? ' Retrieve the type information from the Windows
??? ' Media server running on the remote machine.

??? tServerType = Type.GetTypeFromProgID("WMSServer.Server", "server_name")

??? ' Create an instance of the remote server object locally.
??? RemoteServer = Activator.CreateInstance(tServerType)

Catch errCom As COMException
??? ' TODO: Handle COM exceptions.
Catch err As Exception
??? ' TODO: Exception handler goes here.
Finally
??? ' TODO: Clean-up code goes here.
End Try