CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  .NET技术 >  VB.NET

vb.net程序中如何调用另外一个程序?

楼主gameskybbs(gameskybbs)2003-12-01 20:49:43 在 .NET技术 / VB.NET 提问

例如程序A.exe的运行当中,要调用程序B.exe,然后关闭自己(A.exe)?请问如何实现?最好给点示例代码!!谢谢  
  问题点数:100、回复次数:3Top

1 楼redlion963(狮子)回复于 2003-12-01 20:58:22 得分 40

System.Diagnostics.Process  
   
  看以上的类  
   
  Imports   System  
  Imports   System.Diagnostics  
  Imports   System.ComponentModel  
   
   
  Namespace   MyProcessSample  
          _  
        '/   <summary>  
        '/   Shell   for   the   sample.  
        '/   </summary>  
        Public   Class   MyProcess  
               
               
              '/   <summary>  
              '/   Opens   the   Internet   Explorer   application.  
              '/   </summary>  
              Public   Sub   OpenApplication(myFavoritesPath   As   String)  
                    '   Start   Internet   Explorer.   Defaults   to   the   home   page.  
                    Process.Start("IExplore.exe")  
                     
                    '   Display   the   contents   of   the   favorites   folder   in   the   browser.  
                    Process.Start(myFavoritesPath)  
              End   Sub   'OpenApplication  
                 
               
              '/   <summary>  
              '/   Opens   urls   and   .html   documents   using   Internet   Explorer.  
              '/   </summary>  
              Public   Sub   OpenWithArguments()  
                    '   url's   are   not   considered   documents.   They   can   only   be   opened  
                    '   by   passing   them   as   arguments.  
                    Process.Start("IExplore.exe",   "www.northwindtraders.com")  
                     
                    '   Start   a   Web   page   using   a   browser   associated   with   .html   and   .asp   files.  
                    Process.Start("IExplore.exe",   "C:\myPath\myFile.htm")  
                    Process.Start("IExplore.exe",   "C:\myPath\myFile.asp")  
              End   Sub   'OpenWithArguments  
               
               
              '/   <summary>  
              '/   Uses   the   ProcessStartInfo   class   to   start   new   processes,   both   in   a   minimized    
              '/   mode.  
              '/   </summary>  
              Public   Sub   OpenWithStartInfo()  
                     
                    Dim   startInfo   As   New   ProcessStartInfo("IExplore.exe")  
                    startInfo.WindowStyle   =   ProcessWindowStyle.Minimized  
                     
                    Process.Start(startInfo)  
                     
                    startInfo.Arguments   =   "www.northwindtraders.com"  
                     
                    Process.Start(startInfo)  
              End   Sub   'OpenWithStartInfo  
                 
               
              Public   Shared   Sub   Main()  
                    '   Get   the   path   that   stores   favorite   links.  
                    Dim   myFavoritesPath   As   String   =   Environment.GetFolderPath(Environment.SpecialFolder.Favorites)  
                     
                    Dim   myProcess   As   New   MyProcess()  
                     
                    myProcess.OpenApplication(myFavoritesPath)  
                    myProcess.OpenWithArguments()  
                    myProcess.OpenWithStartInfo()  
              End   Sub   'Main    
        End   Class   'MyProcess  
  End   Namespace   'MyProcessSample  
   
   
  Top

2 楼ericvan(eric)回复于 2003-12-01 21:04:39 得分 0

up!Top

3 楼scegg(Silent)回复于 2003-12-01 21:08:34 得分 60

shell   ("b.exe")  
  end  
  Top

相关问题

  • 如何在JAVA中调用VB程序
  • 在VB中怎样调用外程序?
  • VB中调用shell程序(.bat)
  • 如何通过java程序调用vb程序
  • 请问VBA程序(调用了VB程序)如何发布?
  • VB程序调用我写的DLL打开串口程序?
  • vc程序调用vb程序的问题
  • 在.net程序中调用office
  • 在.net程序中调用office
  • vc如何调用.net的程序

关键词

  • start
  • internet
  • myfavoritespath
  • myprocess
  • 程序
  • openapplication
  • openwitharguments
  • openwithstartinfo
  • iexplore
  • startinfo

得分解答快速导航

  • 帖主:gameskybbs
  • redlion963
  • scegg

相关链接

  • CSDN .NET频道
  • .NET类图书
  • C#类图书
  • .NET类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo