新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
C#調(diào)用瀏覽器的功能實現(xiàn)淺析
C#調(diào)用瀏覽器是如何實現(xiàn)的呢?我們在實際的開發(fā)過程中會遇到這樣的需求,那么來實現(xiàn)C#調(diào)用瀏覽器會用到什么方法呢?這里向你介紹了調(diào)用IE以及默認(rèn)瀏覽器的具體操作。

C#調(diào)用瀏覽器之調(diào)用IE:
- System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
- myProcess.StartInfo.FileName = "iexplore.exe";
- myProcess.StartInfo.Arguments = " http://www.net0and1.com/";
- myProcess.Start();
C#調(diào)用瀏覽器之調(diào)用默認(rèn)瀏覽器:
- string target= "http://www.net0and1.com";
- //Use no more than one assignment when you test this code.
- //string target = "ftp://ftp.microsoft.com";
- //string target = "C:\\Program Files\\Microsoft Visual Studio\\INSTALL.HTM";
- try
- {
- System.Diagnostics.Process.Start(target);
- }
- catch
- (
- System.ComponentModel.Win32Exception noBrowser)
- {
- if (noBrowser.ErrorCode==-2147467259)
- MessageBox.Show(noBrowser.Message);
- }
- catch (System.Exception other)
- {
- MessageBox.Show(other.Message);
- }
C#調(diào)用瀏覽器的操作就向你介紹到這里,希望對你了解和學(xué)習(xí)使用C#調(diào)用瀏覽器有所幫助。
文章題目:C#調(diào)用瀏覽器的功能實現(xiàn)淺析
當(dāng)前網(wǎng)址:http://m.fisionsoft.com.cn/article/dhpeipg.html


咨詢
建站咨詢
