?? portalclass.cs
字號:
using System;
using System.Windows.Forms;
using System.Configuration;
using CallCenter.BusinessInterfaces.MainForms;
using System.Threading;
using System.Runtime.InteropServices;
using System.Collections;
namespace CallCenter.BusinessInterfaces.MainForms
{
/// <summary>
/// PortalClass 的摘要說明。
/// </summary>
public class PortalClass
{
// [DllImport("appface.dll")]
// public static extern int SkinStart(string SkinFile,int nDefWinType,string CheckSum,int nType,
// int hInstance,int nLen);
// [DllImport("appface.dll")]
// public static extern int SkinRemove() ;
// [DllImport("appface.dll")]
// public static extern int SkinWindowSet(IntPtr hWnd,int nSkintype);
// [DllImport("appface.dll")]
// public static extern int SkinWindowSetEx(IntPtr hWnd,int nSkintype,int nResourceId,
// int nUrfLoadType,string SkinFile,int hInstance,int nLen);
public PortalClass()
{
//
// TODO: 在此處添加構造函數邏輯
//
}
[System.STAThread]
public static void Main()
{
try
{
MainWindow app = new MainWindow();
Run();
}
catch(ApplicationException ex)
{
MessageBox.Show(ex.Message,"error");
//MessageBox.Show("111");
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,"error");
}
}
[StructLayout( LayoutKind.Sequential)]
public class SECURITY_ATTRIBUTES
{
public int nLength;
public int lpSecurityDescriptor;
public int bInheritHandle;
}
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern int GetLastError();
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern IntPtr CreateMutex(SECURITY_ATTRIBUTES lpMutexAttributes,bool bInitialOwner,string lpName);
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern int ReleaseMutex(IntPtr hMutex);
const int ERROR_ALREADY_EXISTS = 0183;
private static void Run()
{
// if(SkinStart("belv.urf",4,"",1,0,0) == 0)
// {
// MessageBox.Show("不能找到指定的皮膚");
// SkinStart("belv.urf",4,"",1,0,0);
// }
frmLogIn f=new frmLogIn();
DialogResult dialog=f.ShowDialog();
if(dialog==DialogResult.Cancel)
{
return ;
}
MainWindow mainForm = new MainWindow();
IntPtr hMutex;
hMutex=CreateMutex(null,false,"test");
if (GetLastError()!=ERROR_ALREADY_EXISTS)
{
// ReadMySettings();
Application.Run(mainForm);
}
else
{
MessageBox.Show("本程序只允許同時運行一個");
ReleaseMutex(hMutex);
}
}
// public static void SkinRemoveM()
// {
// SkinRemove();
// }
public static void ReadMySettings()
{
string sampleTable =(string)ConfigurationSettings.GetConfig("sampleSection");
MessageBox.Show(sampleTable);
}
// private void ReadConfige()
// {
// ShareClass.backColor = ConfigurationSettings.AppSettings["BackColor"];
// }
private static void Logon()
{
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -