init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lskj.SMSCenter", "Lskj.SMSCenter\Lskj.SMSCenter.csproj", "{AEDD8899-C5D8-4634-9614-154D5CA31208}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonLib", "..\CommonLib\CommonLib.csproj", "{3E8E6529-5D8A-4F17-8C41-27CD7380178D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CCPRestSDK", "..\CCPRestSDK\CCPRestSDK.csproj", "{80326A65-5E30-4238-BD00-B9FD69A53B91}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Debug|x86.Build.0 = Debug|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Release|x86.ActiveCfg = Release|x86
|
||||
{AEDD8899-C5D8-4634-9614-154D5CA31208}.Release|x86.Build.0 = Release|x86
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{3E8E6529-5D8A-4F17-8C41-27CD7380178D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{80326A65-5E30-4238-BD00-B9FD69A53B91}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,73 @@
|
||||
namespace Lskj.SMSCenter
|
||||
{
|
||||
partial class frmMain
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows 窗体设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
|
||||
this.txtLog = new System.Windows.Forms.TextBox();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtLog
|
||||
//
|
||||
this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtLog.Location = new System.Drawing.Point(0, 0);
|
||||
this.txtLog.Multiline = true;
|
||||
this.txtLog.Name = "txtLog";
|
||||
this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.txtLog.Size = new System.Drawing.Size(472, 402);
|
||||
this.txtLog.TabIndex = 0;
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Interval = 1000;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// frmMain
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(472, 402);
|
||||
this.Controls.Add(this.txtLog);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "frmMain";
|
||||
this.Text = "短信平台";
|
||||
this.Load += new System.EventHandler(this.frmMain_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox txtLog;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
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 CommonLib;
|
||||
using System.Threading;
|
||||
|
||||
namespace Lskj.SMSCenter
|
||||
{
|
||||
public partial class frmMain : Form
|
||||
{
|
||||
CCPRestSDK.CCPRestSDK api = null;
|
||||
public frmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
#region 初始化系统
|
||||
private void frmMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.InitRestCenter(); // 初始化短信平台
|
||||
|
||||
this.timer1.Interval = 5000 * 60; // 默认5分钟发送一次
|
||||
this.timer1.Start();
|
||||
|
||||
// 创建后台线程
|
||||
Thread backThread = new Thread(SendSMS);
|
||||
backThread.IsBackground = true;
|
||||
backThread.Start();
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 初始化短信平台
|
||||
/// <summary>
|
||||
/// 初始化短信平台
|
||||
/// </summary>
|
||||
private void InitRestCenter()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (api == null)
|
||||
{
|
||||
RefreshLog(DateTime.Now + " 正在初始化短信平台.\r\n");
|
||||
if (DBConfig.Instance.CreateConnection())
|
||||
{
|
||||
DataTable dtTable = SqlHelper.ExecuteDataSet("select * from p_systemtab").Tables[0];
|
||||
if (dtTable.Rows.Count > 0)
|
||||
{
|
||||
// 短信key
|
||||
var item = dtTable.Rows[0];
|
||||
string sms_accountSid = item["sms_accountSid"] + "";
|
||||
string sms_accountToken = item["sms_accountToken"] + "";
|
||||
string sms_appId = item["sms_appId"] + "";
|
||||
|
||||
// 初始化短信平台
|
||||
api = InitSMS(sms_accountSid, sms_accountToken, sms_appId);
|
||||
RefreshLog(DateTime.Now + " 初始化短信平台成功.\r\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
RefreshLog(DateTime.Now + string.Format(" 初始化失败.原因:{0}.\r\n", ex.Message));
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送短信
|
||||
/// </summary>
|
||||
/// <param name="phone"></param>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
private CCPRestSDK.CCPRestSDK InitSMS(string accountSid, string accountToken, string appId)
|
||||
{
|
||||
CCPRestSDK.CCPRestSDK api = new CCPRestSDK.CCPRestSDK();
|
||||
|
||||
bool isInit = api.init("app.cloopen.com", "8883");
|
||||
//api.setAccount("8a48b55150b86ee80150c24a9ffb1a84", "019b0877bffc4c2fbcaf0a6edc4ce896");
|
||||
//api.setAppId("8a48b55150b86ee80150c24b839d1a99");
|
||||
// templateId : 46227
|
||||
api.setAccount(accountSid, accountToken);
|
||||
api.setAppId(appId);
|
||||
return api;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 发送短信
|
||||
public void SendSMS()
|
||||
{
|
||||
if (api == null) InitRestCenter();
|
||||
|
||||
Invoke((EventHandler)delegate
|
||||
{
|
||||
txtLog.Text = "";
|
||||
txtLog.Select(txtLog.TextLength, 0);
|
||||
txtLog.ScrollToCaret();
|
||||
});
|
||||
|
||||
RefreshLogUIThread(DateTime.Now + " 开始发送短信.\r\n");
|
||||
string sqlValue = string.Format("select * from P_SystemSMSTempleteTab where ISNULL(isSend,0)=0");
|
||||
DataTable dtTable = SqlHelper.ExecuteDataSet(sqlValue).Tables[0];
|
||||
|
||||
foreach (DataRow sms in dtTable.Rows)
|
||||
{
|
||||
string id = sms["id"] + "";
|
||||
string templeteId = sms["templeteId"] + "";
|
||||
string sendObject = sms["sendObject"] + "";
|
||||
string tempParam1 = sms["tempParam1"] + "";
|
||||
string tempParam2 = sms["tempParam2"] + "";
|
||||
string tempParam3 = sms["tempParam3"] + "";
|
||||
string tempParam4 = sms["tempParam4"] + "";
|
||||
string tempParam5 = sms["tempParam5"] + "";
|
||||
string tempParam6 = sms["tempParam6"] + "";
|
||||
string tempParam7 = sms["tempParam7"] + "";
|
||||
string tempParam8 = sms["tempParam8"] + "";
|
||||
string tempParam9 = sms["tempParam9"] + "";
|
||||
string tempParam10 = sms["tempParam10"] + "";
|
||||
|
||||
if (string.IsNullOrEmpty(sendObject)) continue;
|
||||
|
||||
try
|
||||
{
|
||||
Dictionary<string,object> result = api.SendTemplateSMS(sendObject, templeteId, new string[] { tempParam1, tempParam2, tempParam3, tempParam4,
|
||||
tempParam5, tempParam6, tempParam7, tempParam8, tempParam9, tempParam10 });
|
||||
|
||||
if (result["statusCode"] + "" == "000000")
|
||||
{
|
||||
sqlValue = string.Format("update P_SystemSMSTempleteTab set isSend = 1,SendResult='发送成功',FinishDate=getdate() where id='{0}'", id);
|
||||
SqlHelper.ExecuteNonQuery(sqlValue);
|
||||
|
||||
RefreshLogUIThread(DateTime.Now + string.Format(" {0} 短信发送成功.\r\n", sendObject));
|
||||
}
|
||||
else
|
||||
{
|
||||
sqlValue = string.Format("update P_SystemSMSTempleteTab set isSend = -1,SendResult='发送失败:{1}',FinishDate=getdate() where id='{0}'", id, result["statusMsg"]);
|
||||
SqlHelper.ExecuteNonQuery(sqlValue);
|
||||
RefreshLogUIThread(DateTime.Now + string.Format(" {0} 短信发送失败,错误原因:{1}.\r\n", sendObject, result["statusMsg"]));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
RefreshLogUIThread(DateTime.Now + string.Format(" 短信发送失败{0}.\r\n", sendObject + " 原因:" + ex.Message + Environment.NewLine + ex.InnerException.ToString()));
|
||||
}
|
||||
}
|
||||
RefreshLogUIThread(DateTime.Now + " 本轮短信发送完成.\r\n");
|
||||
RefreshLogUIThread("--------------------分割线------------------------\r\n");
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 后台线程刷新数据
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
public void RefreshLogUIThread(string msg)
|
||||
{
|
||||
Invoke((EventHandler)delegate
|
||||
{
|
||||
txtLog.Text += msg;
|
||||
txtLog.Select(txtLog.TextLength, 0);
|
||||
txtLog.ScrollToCaret();
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 主线程刷新数据
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
public void RefreshLog(string msg)
|
||||
{
|
||||
txtLog.Text += msg;
|
||||
txtLog.Select(txtLog.TextLength, 0);
|
||||
txtLog.ScrollToCaret();
|
||||
}
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
SendSMS();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AEDD8899-C5D8-4634-9614-154D5CA31208}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Lskj.SMSCenter</RootNamespace>
|
||||
<AssemblyName>Lskj.SMSCenter</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\publish\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>sms.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CommonLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\引用DLL\CommonLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FrmMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmMain.Designer.cs">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="FrmMain.resx">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="sms.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\CCPRestSDK\CCPRestSDK.csproj">
|
||||
<Project>{80326A65-5E30-4238-BD00-B9FD69A53B91}</Project>
|
||||
<Name>CCPRestSDK</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.SMSCenter
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new frmMain());
|
||||
}
|
||||
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
||||
{
|
||||
Exception ex = e.Exception;
|
||||
//做一些极其简单的记录异常信息操作
|
||||
MessageBox.Show(ex.Message + Environment.NewLine + ex.InnerException.ToString(), "严重错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过以下
|
||||
// 特性集控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("Lskj.SMSCenter")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("Lskj.SMSCenter")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("9dfcf652-a34c-4553-acd2-8c60a2153ca3")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.18408
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Lskj.SMSCenter.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lskj.SMSCenter.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用此强类型资源类,为所有资源查找
|
||||
/// 重写当前线程的 CurrentUICulture 属性。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.18408
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Lskj.SMSCenter.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 186 KiB |
Reference in New Issue
Block a user