English 中文(简体)
从C#的背景来看,Run firefox
原标题:Run firefox in background from C#

我从C#开始,手法如下:

System.Diagnostics.Process.Start(browser.Document.Url.ToString());

我想从这个背景来看,因为每次都打开一个新表格,视窗都把注意力集中在“灵”上,是空洞的。

我怎么能控制陈列,在一段时间后关闭?

问题回答

你们可以使用一种程序信息,告诉它,它会藏匿或尽量减少,或者不管怎样。 我不肯定如何从方案上操纵Fox,但我确信有APIC。

    var psi = new System.Diagnostics.ProcessStartInfo();
    psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
    psi.FileName = browser.Document.Url.ToString();
    var proc = System.Diagnostics.Process.Start(psi);

    //after a while...
    proc.Kill();

Technically, you are not starting Firefox, you are executing a url. I m not sure exactly what Windows does, but in effect, that url is opened in the system s default browser, be it IE, FF or some other thing that might not even support tabs, so finding and killing Firefox is not really a solution if the url is opened in Opera.

此外,<代码>程序。 起始方法回归无效,如果电话实际上没有启动任何程序,那么,如果>程序已经运行,而且只是显示另外的表格,那么,根据电话,你将获得<>null<>>>>>。

因此,我确信,这在广义上是不可能做到的(任何浏览器),而且,除非“......”对客户管理有某种亚特兰大的,否则不可能这样做。

BTW,在我的系统中(IE是缺损浏览器),WindowStyle 财产没有按预期运作,因为IE在前线居住。

为什么不仅仅杀害整个“纳尔多”进程,并定期重新启动“纳尔多”进程?

你们赢得了这种能力。 首先,在新桌子开张时,我 sure忙地掌握着这个背景。 其次,很难从方案角度控制火灾。 你们想要做的事情的唯一途径是使用像MozRepl这样的花.。 你也可以尝试利用 se或你自己的Script来控制浏览器的行为。 我需要能够在不使用 se或MozRepl的情况下打开和关闭纸面,检查我的。 从彩虹/阿>特定情况下的新表格开放





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签