我必须使用C#打开最大化的Internet Explorer.我尝试过以下方法:
try
{
var IE = new SHDocVw.InternetExplorer();
object URL = "http://localhost/client.html";
IE.ToolBar = 0;
IE.StatusBar = true;
IE.MenuBar = true;
IE.AddressBar = true;
IE.Width = System.Windows.Forms.SystemInformation.VirtualScreen.Width;
IE.Height = System.Windows.Forms.SystemInformation.VirtualScreen.Height;
IE.Visible = true;
IE.Navigate2(ref URL);
ieOpened = true;
break;
}
catch (Exception)
{
}
Run Code Online (Sandbox Code Playgroud)
我可以打开不同的大小,但我找不到如何打开最大化的IE.我检查了msdn,没有属性可以最大化.
请给我一些建议.
PS:我正在开发C#控制台应用程序,.Net4.5和VS2012
在我的 C# 程序中,我从 PLC 接收日期时间。它以“ ulong ”格式发送数据。如何将 ulong 转换为 DateTime 格式?例如我收到:
ulong timeN = 99844490909448899;//time in nanoseconds
Run Code Online (Sandbox Code Playgroud)
然后我需要将其转换为 DateTime ("MM/dd/yyyy hh:mm:ss") 格式。
我该如何解决这个问题?