Intel チップセット・スペック性能比較|パソコン実験工房資料室 | パソコン工房【公式通販】
インテル100シリーズチップセット比較、まとめ – Skylake対応LGA1151マザーボード特集 | Ark Tech and Market News Vol.300246
公安9課
【Intel Skylake】Z170, H170, B150, H110チップセットの違いについて
【Kaby Lake】Z270, H270チップセットの違いについて
System.Windows.Forms.WebBrowserは、デフォルト状態ではIE7相当。
確認サイト:User Agent String.Com
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Shown(object sender, EventArgs e)
{
webBrowser1.Navigate("http://www.useragentstring.com/");
}
}
}
IE11に変更する場合は、レジストリ「HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION」に
プロセス名と対応するデータを登録する。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private const string strRegPath = @"SoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION";
private Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strRegPath, true);
private string strProcessName = System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe";
public Form1()
{
InitializeComponent();
}
private void Form1_Shown(object sender, EventArgs e)
{
regKey.SetValue(strProcessName, 11001, Microsoft.Win32.RegistryValueKind.DWord);
webBrowser1.Navigate("http://www.useragentstring.com/");
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
regKey.DeleteValue(strProcessName);
regKey.Close();
}
}
}
レジストリに登録するデータを変更すると、他のレンダリングバージョンに変更することも可能。
MSDN Internet Feature Controls (B..C) (Internet Explorer)
また、レジストリを使用せず、NavigateメソッドのadditionalHeadersに、直接UserAgentを指定する方法もある。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private const string strUserAgent = @"User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko";
public Form1()
{
InitializeComponent();
}
private void Form1_Shown(object sender, EventArgs e)
{
webBrowser1.Navigate("http://www.useragentstring.com/", "_self", null, strUserAgent);
}
}
}
System.Threading.Thread.Sleep() を用いてSleep処理を行うと、アプリケーションがフリーズしてしまう。
別スレッドを作成し、Joinで終了を待つことで回避することもできるが、制約が多い。
// using System.Threading;
protected override void main()
{
Thread objThread = new Thread(new ParameterizedThreadStart(ThredSleep));
objThread.Start(5000);
objThread.Join();
MessageBox.Show("OK");
}
/// <summary>
/// 待機処理
/// </summary>
/// <param name="millisecondsTimeout">
/// スリープするミリ秒
/// ParameterizedThreadStartの制約上、object型である必要がある。
/// </param>
private void ThredSleep(object millisecondsTimeout)
{
Thread.Sleep((int)millisecondsTimeout);
async/awaitを用いてSleep処理を行うこと下記のようになる。
protected override async void main()
{
await AsyncSleep(5000);
MessageBox.Show("OK");
}
/// <summary>
/// 待機処理
/// </summary>
/// <param name="millisecondsTimeout">スリープするミリ秒</param>
private async Task AsyncSleep(int millisecondsTimeout)
{
await Task.Delay(millisecondsTimeout);
}
App.xamlのStartupUriを消去し、自動起動される画面を除去
・修正前
<Application x:Class="WpfApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
・修正後
<Application x:Class="WpfApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication">
<Application.Resources>
</Application.Resources>
</Application>
App.xaml.csにOnStartupをオーバーライドし、各画面オブジェクトを生成、Showする。
public partial class App : Application
{
static MainWindow objMainWindow;
static MainWindow objMainWindow2;
protected override void OnStartup(StartupEventArgs e)
{
objMainWindow = new MainWindow();
objMainWindow2 = new MainWindow();
objMainWindow.Show();
objMainWindow2.Show();
}
}
全ての画面が閉じられると、プロセスが終了する。