How to open a notepad with maximized size using asp.net

Abstract


Here we will discuss about how to open Note Pad with maximized size.You can use below code both windows and web application.You must import the System.Diagnostics name space in both windows and web application.

[code]
System.Diagnostics.ProcessStartInfo myProc = new System.Diagnostics.ProcessStartInfo();
myProc.FileName = "Notepad.exe";
myProc.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
System.Diagnostics.Process.Start(myProc);
[/code]

In Web application



[code]
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Diagnostics;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.ProcessStartInfo myProc = new System.Diagnostics.ProcessStartInfo();
myProc.FileName = "Notepad.exe";
myProc.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
System.Diagnostics.Process.Start(myProc);

}

}



[/code]

In Windows Application



[code]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

System.Diagnostics.ProcessStartInfo myProc = new System.Diagnostics.ProcessStartInfo();
myProc.FileName = "Notepad.exe";
myProc.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
System.Diagnostics.Process.Start(myProc);

}
}
}

[/code]

No comments:

Post a Comment

Plz Share your comments...