C# 打开选中文件或文件夹 、窗体居中等
//用资源管理器打开C:\
System.Diagnostics.Process.Start( "explorer.exe ", "C:\ ");
System.Diagnostics.Process.Start( "explorer.exe ", "C:\ ");
System.Diagnostics.Process.Start( "C:\ Temp");
/// <summary>
/// 窗体居中
/// </summary>
/// <param name="form"></param>
public static void SetMid(Form form)
{
form.SetBounds((Screen.GetBounds(form).Width / 2) - (form.Width / 2)
, (Screen.GetBounds(form).Height / 2) - (form.Height / 2)
, form.Width, form.Height, BoundsSpecified.Location);
}
/// 窗体居中
/// </summary>
/// <param name="form"></param>
public static void SetMid(Form form)
{
form.SetBounds((Screen.GetBounds(form).Width / 2) - (form.Width / 2)
, (Screen.GetBounds(form).Height / 2) - (form.Height / 2)
, form.Width, form.Height, BoundsSpecified.Location);
}