Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何禁用.DLL的控制台输出?_C#_Firefox_Watin_Console Output - Fatal编程技术网

C# 如何禁用.DLL的控制台输出?

C# 如何禁用.DLL的控制台输出?,c#,firefox,watin,console-output,C#,Firefox,Watin,Console Output,我曾经在我的Web自动化项目中使用WatiN。但是,我看得很慢。我尝试在FF项目中使用WatiN,但Firefox中的WatiN似乎不如IE中的WatiN强大 在此之前,我研究了如何在Firefox3.5中使用WatiN。因为WatiN为FF2.x和FF3.x提供了jssh。当我将WatiN与JSSHFF3.x一起使用时,FF崩溃。因此,它说SWAT Simple Web Automation Toolkit有一个更新版本的jssh,并且与3.5兼容 我下载了SWAT并将该扩展安装到FF。真的很

我曾经在我的Web自动化项目中使用WatiN。但是,我看得很慢。我尝试在FF项目中使用WatiN,但Firefox中的WatiN似乎不如IE中的WatiN强大

在此之前,我研究了如何在Firefox3.5中使用WatiN。因为WatiN为FF2.x和FF3.x提供了jssh。当我将WatiN与JSSHFF3.x一起使用时,FF崩溃。因此,它说SWAT Simple Web Automation Toolkit有一个更新版本的jssh,并且与3.5兼容

我下载了SWAT并将该扩展安装到FF。真的很管用!但看起来,WatiN不能一次打开多个FF页面,也不能在FF页面已经打开时打开FF页面。这很烦人

所以,我又去了斯瓦特。很少有用于SWAT的C文档,但是SWAT的脚本语言已经几乎与C相同。斯瓦特的一切看起来都很好,但在IE方面还不如WatiN好,但对于FF来说,它比WatiN好

如果我不共享我的项目,我更喜欢控制台应用程序而不是GUI。因此,我创建了一个控制台应用程序。写代码等等。。。我运行了我的项目,但SWAT似乎发送了调试输出或控制台输出/打印或其他内容

例如:当我使用此代码时:

var ff = new WebBrowser(BrowserType.FireFox);`
我在控制台屏幕上看到以下文本:

(09.10.2009 09:57:09, 0) - Firefox browser initialized... 
还有更多

我写的代码是:

var ff = new WebBrowser(BrowserType.FireFox);
ff.OpenBrowser();
ff.NavigateBrowser("www.google.com.tr");
ff.SetElementAttribute(IdentifierType.Name,
     "btnG","value","Search with Google!");
控制台输出:

(09.10.2009 10:04:56, 0) - Firefox browser initialized...
(09.10.2009 10:04:56, 0) - Starting firefox process..
(09.10.2009 10:04:56, 0) - Found firefox window, attempting to establish connect
ion..
(09.10.2009 10:04:58, 0) - Connected, attempting to attach to browser
(09.10.2009 10:04:58, 0) - Attempting to attach to window about:config
(09.10.2009 10:04:58, 0) - Send: indexCount = 0;window = null;i = 0;for(i = 0;i
< getWindows().length;i++){var windowTitle = getWindows()[i].document.title.toLo
werCase(); if(windowTitle.indexOf('about:config') > -1){if(indexCount ==0){windo
w = getWindows()[i];break;}else indexCount++;}}
(09.10.2009 10:04:58, 0) - Received: Welcome to the Mozilla JavaScript Shell!
(09.10.2009 10:04:58, 0) - Send: window
(09.10.2009 10:04:58, 0) - Received: [object ChromeWindow]
(09.10.2009 10:04:58, 0) - Send: var browser = window.getBrowser();print(window.
document.title);
(09.10.2009 10:04:58, 0) - Received: [object ChromeWindow]
(09.10.2009 10:04:58, 0) - Send: var browser = window.getBrowser();print(window.
document.title);
(09.10.2009 10:04:58, 0) - Received: about:config - Mozilla Firefox
(09.10.2009 10:04:58, 0) - Send: browser.loadURI("www.google.com.tr");print('OK'
);
(09.10.2009 10:04:58, 0) - Received: about:config - Mozilla Firefox
(09.10.2009 10:04:58, 0) - Send: browser.webProgress.busyFlags
(09.10.2009 10:04:58, 0) - Received: OK
(09.10.2009 10:04:58, 0) - Send: browser.webProgress.busyFlags
(09.10.2009 10:04:58, 0) - Received: 3
(09.10.2009 10:04:59, 0) - Send: browser.webProgress.busyFlags
(09.10.2009 10:04:59, 0) - Received: 5
(09.10.2009 10:04:59, 0) - Send: browser.webProgress.busyFlags
(09.10.2009 10:04:59, 0) - Received: 5
(09.10.2009 10:04:59, 0) - Send: browser.webProgress.busyFlags
(09.10.2009 10:04:59, 0) - Received: 5
(09.10.2009 10:05:00, 0) - Send: browser.webProgress.busyFlags
(09.10.2009 10:05:00, 0) - Received: 0
(09.10.2009 10:05:00, 0) - Send: print(window.document.title)
(09.10.2009 10:05:00, 0) - Received: Google - Mozilla Firefox
(09.10.2009 10:05:00, 0) - Send: print(browser.currentURI.spec)
(09.10.2009 10:05:00, 0) - Received: http://www.google.com.tr/
(09.10.2009 10:05:00, 0) - Send: var doc = browser.contentDocument;print('OK')
(09.10.2009 10:05:00, 0) - Received: OK
(09.10.2009 10:05:00, 0) - Send: browser.webProgress.busyFlags
(09.10.2009 10:05:01, 0) - Received: 0
(09.10.2009 10:05:01, 0) - Send: print(window.document.title)
(09.10.2009 10:05:01, 0) - Received: Google - Mozilla Firefox
(09.10.2009 10:05:01, 0) - Send: print(browser.currentURI.spec)
(09.10.2009 10:05:01, 0) - Received: http://www.google.com.tr/
(09.10.2009 10:05:01, 0) - Send: var doc = browser.contentDocument;print('OK')
(09.10.2009 10:05:01, 0) - Received: OK
(09.10.2009 10:05:01, 0) - Send: var elem = null;elem = doc.getElementsByName('b
tnG')[0];if(elem == null){for(i =0;i < doc.getElementsByTagName('iframe').length
;i++){ if(doc.getElementsByTagName('iframe')[i].contentDocument.getElementsByNam
e('btnG')[0]!=null){elem = doc.getElementsByTagName('iframe')[i].contentDocument
.getElementsByName('btnG')[0]; break;}}}if(elem == null){for(i =0;i < doc.getEle
mentsByTagName('frame').length;i++){ if(doc.getElementsByTagName('frame')[i].con
tentDocument.getElementsByName('btnG')[0]!=null){elem = doc.getElementsByTagName
('frame')[i].contentDocument.getElementsByName('btnG')[0]; break;}}}var origColo
r = '';if(elem != null){origColor = elem.style.backgroundColor;if(origColor == n
ull)origColor = '';elem.style.backgroundColor = 'yellow';}if(elem != null){ elem
.value = 'Search with Google!';print('OK');}else{ print('failed');}
(09.10.2009 10:05:02, 0) - Received: OK
(09.10.2009 10:05:02, 0) - Send: if(elem != null){elem.style.backgroundColor = o
rigColor;elem = null;};print('OK')
(09.10.2009 10:05:02, 0) - Received: OK
如何禁用此输出?我将在控制台屏幕上打印一些内容,它们很重要:


谢谢…

也许您可以更改日志记录选项。找到显示可以控制的消息