using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Windows;
namespace FM
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
Process process = Process.GetCurrentProcess();
foreach (Process p in Process.GetProcessesByName(process.ProcessName))
{
if (p.Id != process.Id)
{
MessageBox.Show("您的程序已经启动");
Application.Current.Shutdown();
return;
}
}
base.OnStartup(e);
if (e.Args.Length == 2)
{
Arg.ThisWbName = e.Args[0];
Arg.ThisShtName = e.Args[1];
}
//foreach (var item in e.Args)
//{
// MessageBox.Show(item);
//}
}
}
public class Arg
{
public static string ThisWbName { get; set; }
public static string ThisShtName { get; set; }
}
}