将 java 项目转换为 .Net 后如何访问 System.getProperties()
我正在尝试在 .Net 中使用 HTMLUnit 我遵循 Steven Sanderson 博客中的示例 http://blog.stevensanderson.com/2010/03/30/using-htmlunit-on-net-for-headless-browser-automation/ 效果很好。但是我遇到了如何禁用java中的运行时警告? 我想降低 Log4J 的噪音。
如前所述,我需要执行以下操作:-
System.getProperties().put("org.apache.commons.logging.simplelog.defaultlog","fatal");
但我不知道如何在 .Net 中执行此操作。任何帮助将不胜感激。
西蒙
I am trying to use HTMLUnit in .Net I followed the example in Steven Sanderson's blog http://blog.stevensanderson.com/2010/03/30/using-htmlunit-on-net-for-headless-browser-automation/ which works well. However I have encontered the problem mentioned in How to disable runtime warnings in java? where I want to turn down the noise from Log4J.
As stated I need to do the following:-
System.getProperties().put("org.apache.commons.logging.simplelog.defaultlog","fatal");
But I have no idea how to do this in .Net. Any help would be much appreciated.
Simon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
.NET 的配置系统与 Java 的配置系统有很大不同(他说,他已经 10 多年没有编写任何 Java 了!)。请查看此处以开始使用:http://msdn。 microsoft.com/en-us/library/system.configuration.configurationsettings.aspx
您还可以为更复杂的定制配置方案编写自定义配置部分/处理程序。 http://msdn.microsoft.com/en-us/library/ie /2tw134k3.aspx
The config system is .NET considerably different to that in Java (he said, not having written any Java for over 10 years!). Take a look here to get you started : http://msdn.microsoft.com/en-us/library/system.configuration.configurationsettings.aspx
You can also write custom config sections/handler for more complex bespoke config scenarios. http://msdn.microsoft.com/en-us/library/ie/2tw134k3.aspx