国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
Process.Start命令行的5種使用方法
Process.Start命令行的5種使用方法
作者:Ilu    來源:樂博網整理     更新時間:2009-9-5

Process.Start命令行的5種使用方法

1. Process.Start 實例

First, here is an example VB.NET program that uses Process.Start to open the file manager on your C:\ drive. When you run this example the root directory folder will open.

Module Module1            Sub Main()            Process.Start("C:\")            End Sub            End Module

Description of the example code. The Main entry point is declared above and it contains a single line of code, which calls the Process.Start Shared method. It passes one parameter to Process.Start, the directory root.

2. Process.Start打開TXT文本文件

Here we see that when you specify a certain file for Process.Start to open, the default Windows file viewer for the file type will open. This is useful for text files, Microsoft Office files, and many other files.

Module Module1            Sub Main() 'vb.net源碼和實例,來自樂博網 www.lob.cn            ' Open the file 'example.txt' at the current program's directory.            ' It will appear in the default text file viewer.            Process.Start("example.txt")            End Sub            End Module

Description of the example VB.NET code. The Main entry point subroutine is declared above. It contains a comment and one call to Process.Start. The "example.txt" file must be found in the program's current directory. Notepad or any text viewer will open. This can be useful for "Read Me" files.

Description of file paths. Instead of just passing "example.txt", you could pass "C:\Users\Sam\example.txt" to specify the absolute directory.

3. Process.Start進行google搜索

In many programs, resources can be given to the user in the form of URLs. You can tell Windows to launch a web browser window with a specific URL. All you have to do is send Process.Start the URL. It is important that you do not specify IEXPLORE unless IE is required.

Module Module1            Sub Main()            SearchGoogle("樂博網")            End Sub            ''' <summary>            ''' Open the user's default browser and search for the parameter.            ''' </summary>            Private Sub SearchGoogle(ByVal t As String)            Process.Start("http://www.google.cn/search?q=" & t)            End Sub            End Module

Description of the example subroutines. You can see that the subroutine SearchGoogle() is called with a String parameter. The SearchGoogle function is then run, and it calls Process.Start. The base URL for a Google search is specified. The query string is then set to the parameter.

 

Note on specifying browser executables. Many users and organizations have certain web browsers they use. However, these should be set at the system-level in Windows. Therefore, you shouldn't normally specify IEXPLORE.EXE here.

本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現有害或侵權內容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
[Unity3d]C#調用WINDOWS命令行(CMD)
tcpip詳解筆記(7) ping
命令行刪除windows系統(tǒng)服務辦法一:
C# 關閉計算機
Jetty:基本功能介紹
C# 調用命令行執(zhí)行Cmd命令的操作
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯系客服!

聯系客服