使用asp.net在不同的浏览器中以编程方式打开网页 [英] programmatically opening web pages in different browsers using asp.net

查看:220
本文介绍了使用asp.net在不同的浏览器中以编程方式打开网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..............
我想使用asp.net在不同的浏览器中以编程方式打开我的网页,即在mozila中打开的网页,chrome取决于用户输入.我想在asp.net.com中为此功能提供解决方案.

提前感谢

hi..............
I want open my web page programmatically in different browsers using asp.net i.e web pages open in mozila,chrome depends on user input.I want to this functionality in asp.net.provide soln for it.

Thanx in advance

推荐答案

System.Diagnostics.Process proc = new System.Diagnostics.Process();
如果(您的Firefox条件)
{
proc.StartInfo.FileName ="firefox";
}
否则if(ie的条件)
{
proc.StartInfo.FileName ="iexplore";
}
否则,如果(您的镀铬条件)
{
proc.StartInfo.FileName ="chrome";
}

等等.....

proc.StartInfo.Arguments ="www.google.com";
proc.Start();
System.Diagnostics.Process proc = new System.Diagnostics.Process();
If(ur condition for firefox)
{
proc.StartInfo.FileName = "firefox";
}
else if(ur condition for ie)
{
proc.StartInfo.FileName = "iexplore";
}
else if(ur condition for chrome)
{
proc.StartInfo.FileName = "chrome";
}

and so on.....

proc.StartInfo.Arguments = "www.google.com";
proc.Start();


只需右键单击Visual Studio上的页面,选择浏览方式,然后选择所需的浏览器.
Just right click on the page on Visual Studio, choose browse with and then select the browser of your choice.


你好我亲爱的朋友!

转到解决方案资源管理器,(Ctrl + Alt + S)

右键单击您的项目名称->点击浏览->从列表中选择浏览器->设置为默认值.

如果需要,可以从列表中设置浏览器窗口的大小.


谢谢.
Hello My Dear Friend !!

Go to Solution Explorer,(Ctrl+Alt+S)

Right Click on Your Project name -> Click on Browse with -> select the browser from list -> Set as Default.

if you want, you can set the size of the browser window from list.


Thanks.


这篇关于使用asp.net在不同的浏览器中以编程方式打开网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆