Command line switches
This commit is contained in:
parent
0e579459fc
commit
66726b87c7
|
@ -253,7 +253,10 @@ namespace Notepad
|
||||||
|
|
||||||
private void Form1_Load(object sender, EventArgs e)
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (File.Exists(Global.savefilename))
|
||||||
|
{
|
||||||
|
text_area.Text = File.ReadAllText(Global.savefilename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void aboutWindowsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void aboutWindowsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Notepad
|
namespace Notepad
|
||||||
{
|
{
|
||||||
|
@ -35,10 +36,18 @@ namespace Notepad
|
||||||
/// Punto di ingresso principale dell'applicazione.
|
/// Punto di ingresso principale dell'applicazione.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main(string[] switches)
|
||||||
{
|
{
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
if (switches.Length == 1)
|
||||||
|
{
|
||||||
|
string arg = switches[0].Trim();
|
||||||
|
if (File.Exists(arg))
|
||||||
|
{
|
||||||
|
Global.savefilename = arg;
|
||||||
|
}
|
||||||
|
}
|
||||||
Application.Run(new Form1());
|
Application.Run(new Form1());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue