Commit 8f20143f by zxw

winxp充电台

parent 241fef9e
......@@ -334,6 +334,7 @@ namespace JmpServiceMgr
try
{
new DevService().OnStart(MyCache.SysConfig.DomainUrl);
Log.WorkLog("除湿机启动成功");
}
catch (Exception e)
{
......
......@@ -14,6 +14,7 @@ using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using JmpCommon;
namespace JmpServiceMgr.Helper
{
......@@ -34,7 +35,7 @@ namespace JmpServiceMgr.Helper
try
{
//获取接口地址
//URL = Properties.Settings.Default.URL;
this.URL = URL;
devCode = GetMacAddress().ToUpper();
#region 开启一个线程
......@@ -109,6 +110,7 @@ namespace JmpServiceMgr.Helper
string retrundata = GetHttpRqst(serviceUrl, data);
JsonData json = JsonMapper.ToObject(retrundata);
if (getKey(json, "code").Equals("10000"))
{
if (JsonDataContainsKey(json, "msg"))
......@@ -149,7 +151,7 @@ namespace JmpServiceMgr.Helper
Thread.Sleep(5000);
}
}
private void OnStatusChanged(MachineStatus args)
{
......@@ -167,7 +169,7 @@ namespace JmpServiceMgr.Helper
else
{
foreach (var item in devList)
{
{
if (item.Key.Equals(args.ip))
{
Dehumidifier dev = new Dehumidifier(args.ip, args.port);
......
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.15.09260")]
[assembly: AssemblyFileVersion("1.2.15.09260")]
[assembly: AssemblyVersion("1.2.16.09270")]
[assembly: AssemblyFileVersion("1.2.16.09270")]
......@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiteChannel", "LiteChannel\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightCtrl", "LightCtrl\LightCtrl.csproj", "{01C90EA0-0E78-4A2C-8D72-BE8101932585}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiteChannelWinXP", "LiteChannelWinXP\LiteChannelWinXP.csproj", "{48900448-82F0-4876-9987-0AAB845027D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -39,12 +41,16 @@ Global
{01C90EA0-0E78-4A2C-8D72-BE8101932585}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01C90EA0-0E78-4A2C-8D72-BE8101932585}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01C90EA0-0E78-4A2C-8D72-BE8101932585}.Release|Any CPU.Build.0 = Release|Any CPU
{48900448-82F0-4876-9987-0AAB845027D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48900448-82F0-4876-9987-0AAB845027D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48900448-82F0-4876-9987-0AAB845027D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48900448-82F0-4876-9987-0AAB845027D5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F1BB736E-801B-4BAD-8BC5-A7BA50F023D7}
VisualSVNWorkingCopyRoot = .
SolutionGuid = {F1BB736E-801B-4BAD-8BC5-A7BA50F023D7}
EndGlobalSection
EndGlobal
......@@ -273,4 +273,8 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\MaterialDesignThemes.3.1.3\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.3.1.3\build\MaterialDesignThemes.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>xcopy $(ProjectDir)ThirdPackages\* $(TargetDir) /S /Y
</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
#缺省不输出日志到控制台
#FATAL、ERROR、WARN、INFO、DEBUG 优先级顺序 如果子模块和根模块都匹配,那么都会输出
log4j.rootLogger=DEBUG, default
#log4j.rootLogger=DEBUG
##hlog.async=false
##hlog.secret.show=true
##hlog.secret.encrypt=false
#log4j.logger用于控制日志采集级别及采集内容,Threshold用于控制日志输出级别
#应用于控制台
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d][%t][%-5p]- %m%n
log4j.logger.NPQ=TRACE, NPQ
log4j.appender.NPQ=org.apache.log4j.RollingFileAppender
log4j.appender.NPQ.File=./NPQLog/NPQ.log
log4j.appender.NPQ.MaxFileSize=80MB
log4j.appender.NPQ.MaxBackupIndex=12
log4j.appender.NPQ.Append=false
log4j.appender.NPQ.Threshold=TRACE
log4j.appender.NPQ.layout=org.apache.log4j.PatternLayout
log4j.appender.NPQ.layout.ConversionPattern=[%d][%t][%-5p]- %m%n
log4j.additivity.NPQ = false
#最后一位修改为true 既可以控制台输出又可以文件输出
#log4j.logger用于控制日志采集级别及采集内容,Threshold用于控制日志输出级别
#应用于控制台
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p - %m%n
#应用于文件回滚
log4j.appender.default=org.apache.log4j.RollingFileAppender
log4j.appender.default.File=./log/DefaultClient.log
log4j.appender.default.MaxBackupIndex=12
log4j.appender.default.MaxFileSize=20MB
log4j.appender.default.Append=true
log4j.appender.default.Threshol= TRACE
log4j.appender.default.layout=org.apache.log4j.PatternLayout
log4j.appender.default.layout.ConversionPattern=%d [%t] %-5p %.16c - %m%n
#设置VMS
log4j.logger.Crash=TRACE, Crash
#每天产生一个日志文件
log4j.appender.Crash=org.apache.log4j.DailyRollingFileAppender
log4j.appender.Crash.File=./log/CrashClient.log
log4j.appender.Crash.DatePattern='.'yyyy-MM-dd
log4j.appender.Crash.Append=true
log4j.appender.Crash.Threshold=TRACE
log4j.appender.Crash.layout=org.apache.log4j.PatternLayout
log4j.appender.Crash.layout.ConversionPattern=%d [%t] %-5p %.16c - %m%n
##hlog.async=false
##hlog.secret.show=false
##hlog.secret.encrypt=true
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Commons
{
public class JmpDes
{
/// <summary> 加密字符串
/// </summary>
/// <param name="strText">需被加密的字符串</param>
/// <param name="strEncrKey">密钥</param>
/// <returns></returns>
public static string Encrypt(string strText, string strKey = "jMp838668")
{
try
{
byte[] byKey = null;
byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
byKey = Encoding.UTF8.GetBytes(strKey.Substring(0, 8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
byte[] inputByteArray = Encoding.UTF8.GetBytes(strText);
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(byKey, IV), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();
return Convert.ToBase64String(ms.ToArray());
}
catch
{
return "";
}
}
/// <summary> 解密字符串
/// </summary>
/// <param name="strText">需被解密的字符串</param>
/// <param name="sDecrKey">密钥</param>
/// <returns></returns>
public static string Decrypt(string strText, string strKey = "jMp838668")
{
try
{
byte[] byKey = null;
byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
byte[] inputByteArray = new Byte[strText.Length];
byKey = Encoding.UTF8.GetBytes(strKey.Substring(0, 8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
inputByteArray = Convert.FromBase64String(strText);
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();
Encoding encoding = new UTF8Encoding();
return encoding.GetString(ms.ToArray());
}
catch
{
return string.Empty;
}
}
}
}
using LiteChannelWinXP.Commons;
using LiteChannelWinXP.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
namespace LiteChannelWinXP
{
public static class LiteCaChe
{
public static List<sync_police> PoliceList { get; set; }
public static List<store_info> warehouseList { get; set; }
public static string OrgId { get; set; }
public static string PoliceId { get; set; }
public static string UserId { get; set; }
public static List<equ_info> EquInfos { get; set; }
public static Config SysConfig { get; set; }
public static Config LoadSystemStep()
{
var v_path = AppDomain.CurrentDomain.BaseDirectory + "config.json";
if (!File.Exists(v_path))
{
return null;
}
else
{
var v_json = File.ReadAllText(v_path, Encoding.Default);
var des_str = JmpDes.Decrypt(v_json);
if (string.IsNullOrEmpty(des_str))
{
return null;
}
else
{
var config = JsonConvert.DeserializeObject<Config>(des_str);
return config;
}
}
}
public static bool SaveSystemStep(Config config)
{
try
{
if (config == null) { return false; }
else
{
var json = JsonConvert.SerializeObject(config, Formatting.Indented);
if (string.IsNullOrEmpty(json))
{
return false;
}
else
{
System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "config.json", JmpDes.Encrypt(json), Encoding.UTF8);
return true;
}
}
}
catch (Exception ex)
{
Log.ErrorLog(ex.ToString(), MethodBase.GetCurrentMethod().Name);
return false;
}
}
}
public class Config
{
public Config()
{
AppTitle = "充电台入库-WinXP v" + FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule.FileName).FileVersion;
AppVersion = FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule.FileName).FileVersion;
AppCode = "10066";
DomainUrl = "http://41.190.20.132:18761/api/service";
UserLogin = "http://41.190.20.132:10004/auth/userLogin";
SoftUpdate = "/api/SoftUpdate/GetLastUpdate";
GetEquInfo = "/api/EquipmentDetail/GetListEquipmentDetail";
GetStoreInfo = "/api/Warehouse/GetListWarehouse";
GetOrderInfo = "/api/Inventory/GetOrderInfo";
GetOrderDetail = "/api/Inventory/GetOrderDetail";
ComMouth = "COM4";
WarehouseID = "d8192b23-0ec9-4b2e-a47d-f6780a66a880";
UploadUrl = "/api/Inventory/UploadRFIDNew";
OpenOrderWorkUrl = "/api/Inventory/OpenThisOrderAndCloseOther";
CloseOrderUrl = "/api/Inventory/CloseOrder";
ApiVersion = "1.0";
AppKey = "q6t0lEKOmMg5Tm+dg3XdZQ==";
SecretKey = "ba4d855b3b83eab441a51ea9bd9d9671";
GetPolices = "/api/ChannelCfg/GetOrgStaff";
FaceAddress = "192.168.8.35";
FaceUser = "admin";
FacePwd = "junmp123";
FacePort = "8000";
UploadFace = "/api/ChannelCfg/UploadFace";
UpdateFinger = "/api/ChannelCfg/UpdateFinger";
IsUseFace = true;
IsEnabledShelf = false;
ShelfAddress = "http://192.168.3.128:38080/api/BoundDocuments";
GetInvListByEpc = "/api/Inventory/GetInvListByEpc";
IsAutoUpdate = true;
AutoUpdateTime = 0;
GetWarehouseById = "/api/Warehouse/GetWarehouseById";
SetWarehouseState = "/api/Inventory/SetWarehouseState";
GetEpcListByBoxMarkEpc = "/api/EquipmentBoxMark/GetEpcListByBoxMarkEpc";
}
/// <summary>
/// 接口域名
/// </summary>
public string DomainUrl { get; set; }
/// <summary>
/// 登录
/// </summary>
public string UserLogin { get; set; }
[JsonIgnore]
public string AppTitle { get; set; }
[JsonIgnore]
public string AppVersion { get; set; }
[JsonIgnore]
public string AppCode { get; set; }
public string SoftUpdate { get; set; }
public string GetEquInfo { get; set; }
public string GetStoreInfo { get; set; }
public string GetOrderInfo { get; set; }
public string GetOrderDetail { get; set; }
public string ComMouth { get; set; }
public string WarehouseID { get; set; }
public string UploadUrl { get; set; }
public string OpenOrderWorkUrl { get; set; }
public string CloseOrderUrl { get; set; }
public string ApiVersion { get; set; }
public string AppKey { get; set; }
public string SecretKey { get; set; }
public string GetPolices { get; set; }
public string FaceAddress { get; set; }
public string FaceUser { get; set; }
public string FacePwd { get; set; }
public string FacePort { get; set; }
public string UploadFace { get; set; }
public string UpdateFinger { get; set; }
public bool IsUseFace { get; set; }
public bool IsEnabledShelf { get; set; }
public string ShelfAddress { get; set; }
public string GetInvListByEpc { get; set; }
public string GetWarehouseById { get; set; }
public string SetWarehouseState { get; set; }
/// <summary>
/// 是否自动更新
/// </summary>
public bool IsAutoUpdate { get; set; }
/// <summary>
/// 自动更新时间(小时)
/// </summary>
public int AutoUpdateTime { get; set; }
[JsonIgnore]
public static new bool IsInDesignModeStatic { get; }
public string GetEpcListByBoxMarkEpc { get; set; }
}
public class respone_user
{
public string id { get; set; }
public string username { get; set; }
public bool enabled { get; set; }
public respone_org baseJpOrganization { get; set; }
public respone_policeman policeman { get; set; }
}
public class respone_org
{
public string id { get; set; }
public string name { get; set; }
public string code { get; set; }
public string findCode { get; set; }
}
public class respone_policeman
{
public string id { get; set; }
public string name { get; set; }
public string policeCode { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Commons
{
public class Log
{
//private static
private static StreamWriter sr;
private static readonly object syncWorkObj = new object();
private static readonly object syncErrorObj = new object();
private static readonly object syncDebugObj = new object();
private static bool bEnableWorkLog = true;
private static bool bEnableErrorLog = true;
private static bool bEnableDebugLog = true;
public Log()
{
}
/// <summary>
/// Log 启用
/// </summary>
/// <param name="enable"></param>
public static void EnableWorkLog(bool enable)
{
bEnableWorkLog = enable;
}
/// <summary>
/// Log 启用
/// </summary>
/// <param name="enable"></param>
public static void EnableErrorLog(bool enable)
{
bEnableErrorLog = enable;
}
/// <summary>
/// Log 启用
/// </summary>
/// <param name="enable"></param>
public static void EnableDebugLog(bool enable)
{
bEnableDebugLog = enable;
}
/// <summary>
/// 工作日志
/// </summary>
/// <param name="logTxt"></param>
/// <param name="ModuleName"></param>
public static void WorkLog(string logTxt, string ModuleName = default)
{
lock (syncWorkObj)
{
if (bEnableWorkLog)
{
WriteLine(logTxt, ModuleName, "WorkLog/");
}
}
}
/// <summary>
/// 异常日志
/// </summary>
/// <param name="logTxt"></param>
/// <param name="ModuleName"></param>
public static void ErrorLog(string logTxt,string ModuleName = default)
{
lock (syncErrorObj)
{
if (bEnableErrorLog)
{
WriteLine(logTxt, ModuleName, "ErrorLog/");
}
}
}
/// <summary>
/// 异常日志
/// </summary>
/// <param name="logTxt"></param>
/// <param name="ModuleName"></param>
public static void DebugLog(string logTxt, string ModuleName = null)
{
lock (syncDebugObj)
{
if (bEnableDebugLog)
{
WriteLine(logTxt, ModuleName, "WorkLog/");
}
}
}
/// <summary>
/// 写日志
/// </summary>
/// <param name="logTxt"></param>
/// <param name="ModuleName"></param>
/// <param name="pathName"></param>
private static void WriteLine(string logTxt, string ModuleName, string pathName)
{
try
{
string logPath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + pathName
+ DateTime.Now.ToString("yyyyMMdd") + ".log";
ClearFile(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + pathName);
logTxt = string.Format(" {0}|{1}|{2}",
DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
ModuleName,
logTxt);
sr = new StreamWriter(logPath, true, Encoding.Default);
sr.WriteLine(logTxt);
sr.Close();
}
catch { }
}
/// <summary>
/// 日志清除文件
/// </summary>
/// <param name="FilePath"></param>
private static void ClearFile(string FilePath)
{
if (!Directory.Exists(FilePath))
{
Directory.CreateDirectory(FilePath);
}
String[] Files = Directory.GetFiles(FilePath);
if (Files.Length > 30)
{
for (int i = 0; i < 1; i++)
{
try
{
File.Delete(Files[i]);
}
catch
{
}
}
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{48900448-82F0-4876-9987-0AAB845027D5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>LiteChannelWinXP</RootNamespace>
<AssemblyName>LiteChannelWinXP</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="JmpRfidLp">
<HintPath>..\Lib\JmpRfidLp.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Commons\EpcConvert.cs" />
<Compile Include="Commons\HttpHelper.cs" />
<Compile Include="Commons\JmpDes.cs" />
<Compile Include="Commons\Log.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Commons\LiteCaChe.cs" />
<Compile Include="Login.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Login.Designer.cs">
<DependentUpon>Login.cs</DependentUpon>
</Compile>
<Compile Include="Setting.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Setting.Designer.cs">
<DependentUpon>Setting.cs</DependentUpon>
</Compile>
<Compile Include="Models\BaseJpWarehouse.cs" />
<Compile Include="Models\equ_info.cs" />
<Compile Include="Models\order_equ.cs" />
<Compile Include="Models\order_info.cs" />
<Compile Include="Models\request_sign.cs" />
<Compile Include="Models\respone.cs" />
<Compile Include="Models\respone_upload.cs" />
<Compile Include="Models\response_BoxMarkModel.cs" />
<Compile Include="Models\rfid_res.cs" />
<Compile Include="Models\scan_info.cs" />
<Compile Include="Models\soft_update.cs" />
<Compile Include="Models\store_info.cs" />
<Compile Include="Models\sync_police.cs" />
<Compile Include="Models\upload_info.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Login.resx">
<DependentUpon>Login.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Setting.resx">
<DependentUpon>Setting.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="packages.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>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file

namespace LiteChannelWinXP
{
partial class Login
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.tb_user = new System.Windows.Forms.TextBox();
this.tb_password = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.cb_saveHistory = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(51, 39);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 0;
this.label1.Text = "账号:";
//
// tb_user
//
this.tb_user.Location = new System.Drawing.Point(98, 36);
this.tb_user.Name = "tb_user";
this.tb_user.Size = new System.Drawing.Size(100, 21);
this.tb_user.TabIndex = 1;
//
// tb_password
//
this.tb_password.Location = new System.Drawing.Point(98, 63);
this.tb_password.Name = "tb_password";
this.tb_password.PasswordChar = '*';
this.tb_password.Size = new System.Drawing.Size(100, 21);
this.tb_password.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(51, 66);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.TabIndex = 2;
this.label2.Text = "密码:";
//
// button1
//
this.button1.Location = new System.Drawing.Point(85, 114);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 4;
this.button1.Text = "登录";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// cb_saveHistory
//
this.cb_saveHistory.AutoSize = true;
this.cb_saveHistory.Location = new System.Drawing.Point(53, 92);
this.cb_saveHistory.Name = "cb_saveHistory";
this.cb_saveHistory.Size = new System.Drawing.Size(72, 16);
this.cb_saveHistory.TabIndex = 5;
this.cb_saveHistory.Text = "记住密码";
this.cb_saveHistory.UseVisualStyleBackColor = true;
//
// Login
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(251, 162);
this.Controls.Add(this.cb_saveHistory);
this.Controls.Add(this.button1);
this.Controls.Add(this.tb_password);
this.Controls.Add(this.label2);
this.Controls.Add(this.tb_user);
this.Controls.Add(this.label1);
this.Name = "Login";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "射频入库系统";
this.Activated += new System.EventHandler(this.Login_Activated);
this.Leave += new System.EventHandler(this.Login_Leave);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tb_user;
private System.Windows.Forms.TextBox tb_password;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.CheckBox cb_saveHistory;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using LiteChannelWinXP.Commons;
namespace LiteChannelWinXP
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
ReadHistory();
}
private void button1_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(tb_user.Text))
{
MessageBox.Show("用户名未填写");
return;
}
if (string.IsNullOrEmpty(tb_password.Text))
{
MessageBox.Show("密码未填写");
return;
}
button1.Text = "登录中";
button1.Enabled = false;
Task.Factory.StartNew(() =>
{
var result = HttpHelper.UserLogin(tb_user.Text, tb_password.Text);
this.Invoke(new Action(() =>
{
button1.Text = "登录";
button1.Enabled = true;
if (result != null)
{
LiteCaChe.OrgId = result.baseJpOrganization.id;
LiteCaChe.PoliceId = result.policeman?.id;
LiteCaChe.warehouseList = HttpHelper.GetStoreInfos(LiteCaChe.OrgId);
if (LiteCaChe.warehouseList.Count == 0)
{
MessageBox.Show("当前账号组织机构下无仓库,程序将自动退出");
this.Close();
return;
}
SaveHistory();
this.Hide();
Login_Leave(null, null);
new MainForm(this).Show();
}
else
{
MessageBox.Show("系统登录失败!");
}
}));
});
}
private void SaveHistory()
{
var path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "history.txt";
if (!File.Exists(path))
{
File.Create(path);
}
if (cb_saveHistory.Checked)
{
var txt = tb_user.Text + "|" + tb_password.Text;
File.WriteAllText(path, txt, Encoding.UTF8);
}
else
{
File.WriteAllText(path, "", Encoding.UTF8);
}
}
public void ReadHistory()
{
var path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "history.txt";
if (!File.Exists(path))
{
File.CreateText(path).Dispose();
}
var txt = File.ReadAllText(path, Encoding.UTF8);
if (!string.IsNullOrEmpty(txt))
{
var record = txt.Split('|');
if (record.Length == 2)
{
tb_user.Text = record[0];
tb_password.Text = record[1];
cb_saveHistory.Checked = true;
}
}
}
protected override void WndProc(ref Message m)
{
const int WM_HOTKEY = 0x0312;
//按快捷键
switch (m.Msg)
{
case WM_HOTKEY:
switch (m.WParam.ToInt32())
{
case 100:
OpenSetting();
break;
}
break;
}
base.WndProc(ref m);
}
private void Login_Leave(object sender, EventArgs e)
{
HotKey.UnregisterHotKey(this.Handle, 100);
}
private void Login_Activated(object sender, EventArgs e)
{
HotKey.RegisterHotKey(this.Handle, 100, HotKey.KeyModifiers.Ctrl | HotKey.KeyModifiers.Alt, (int)Keys.J);
}
private void OpenSetting()
{
try
{
//判断是否已经打开配置界面
bool isContuine = true;
foreach (var frm in Application.OpenForms)
{
if (frm is Setting)
{
isContuine = false;
break;
}
}
if (!isContuine) { return; }
var config = new Setting();
config.ShowDialog();
}
catch (Exception ex)
{
Log.ErrorLog(ex.ToString());
}
}
}
public class HotKey
{
//如果函数执行成功,返回值不为0。
//如果函数执行失败,返回值为0。要得到扩展错误信息,调用GetLastError。
[DllImport("user32.dll", SetLastError = true)]
public static extern bool RegisterHotKey(
IntPtr hWnd, //要定义热键的窗口的句柄
int id, //定义热键ID(不能与其它ID重复)
KeyModifiers fsModifiers, //标识热键是否在按Alt、Ctrl、Shift、Windows等键时才会生效
int vk //定义热键的内容
);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool UnregisterHotKey(
IntPtr hWnd, //要取消热键的窗口的句柄
int id //要取消热键的ID
);
//定义了辅助键的名称(将数字转变为字符以便于记忆,也可去除此枚举而直接使用数值)
[Flags()]
public enum KeyModifiers
{
None = 0,
Alt = 1,
Ctrl = 2,
Shift = 4,
WindowsKey = 8
}
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using JmpRfidLp;
using Newtonsoft.Json;
using System.Configuration;
using System.Diagnostics;
using System.IO.Ports;
using LiteChannelWinXP.Commons;
using LiteChannelWinXP.Models;
namespace LiteChannelWinXP
{
public partial class MainForm : Form
{
private List<scan_info> SourcesList = new List<scan_info>();
private ObservableCollection<scan_info> RefreshSourcesList = new ObservableCollection<scan_info>();
private Reader reader = null;
private Dictionary<string, TagInfo> dic_Tag = new Dictionary<string, TagInfo>();
private Queue<TagInfo> queTags = new Queue<TagInfo>();
private int totalCount = 0;
private long tickStart = DateTime.Now.Ticks;
private bool isStop = true;
private DeviceStatus deviceStatus = DeviceStatus.未连接;
private Login _loginForm;
public MainForm(Login loginForm)
{
_loginForm = loginForm;
InitializeComponent();
this.Text = LiteCaChe.SysConfig.AppTitle;
cb_SerialPort.Items.AddRange(SerialPort.GetPortNames());
if (cb_SerialPort.Items.Count > 0)
{
cb_SerialPort.SelectedIndex = cb_SerialPort.Items.Count - 1;
}
dataGridView1.AutoGenerateColumns = false;
dataGridView1.DataSource = RefreshSourcesList;
cbb_warehouse.DataSource = LiteCaChe.warehouseList;
cbb_warehouse.DisplayMember = "name";
cbb_warehouse.SelectedIndex = 0;
}
private void btn_Open_Click(object sender, EventArgs e)
{
try
{
if (rb_Serial.Checked)
{
if (cb_SerialPort.Text.Length > 0)
{
reader = new Reader(cb_SerialPort.Text);
}
else
{
MessageBox.Show("读选择串口!");
}
}
else
{
reader = new Reader(tb_IP.Text, (int)nud_NetPort.Value);
}
if (reader.Open())
{
reader.OnInventory += new Reader.InvDeleg(OnRadioInventory);
var fw = reader.GetFWVerion();
lb_status.Text = "已连接";
lb_status.ForeColor = Color.Blue;
this.Text += string.Format(" 固件:{0}", fw);
deviceStatus = DeviceStatus.已连接;
groupBox3.Enabled = true;
groupBox2.Enabled = false;
button1.Enabled = true;
button2.Enabled = true;
reader.InventoryStop();
reader.SetPALevel(1);
reader.SetTxPower(0, true, 24);
MessageBox.Show("打开成功");
return;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
MessageBox.Show("打开失败");
}
private void OnRadioInventory(TagInfo args)
{
if (!SourcesList.Any(t => t.epcList.Contains(args.EPC)) && args.EPC.Length == 64)
{
var buffer = EpcConvert.ToHexByte(args.EPC);
var epc_info = EpcConvert.EpcAnlysing(buffer);
if (epc_info != null)
{
var equ_info = LiteCaChe.EquInfos?.FirstOrDefault(t => t.code == epc_info.Wzdm.ToString("X"));
if (equ_info != null)
{
//有效标签
var tmp_info = SourcesList.FirstOrDefault(t => t.equCode == epc_info.Wzdm.ToString("X"));
if (tmp_info == null)
{
tmp_info = new scan_info()
{
epcList = new List<string>() { args.EPC },
equCode = epc_info.Wzdm.ToString("X"),
equName = equ_info.name,
scanQty = 1
};
SourcesList.Add(tmp_info);
RefreshSourcesList = new ObservableCollection<scan_info>(SourcesList);
this.Invoke(new Action(() =>
{
dataGridView1.DataSource = RefreshSourcesList;
}));
}
else
{
tmp_info.scanQty += 1;
tmp_info.epcList.Add(args.EPC);
RefreshSourcesList = new ObservableCollection<scan_info>(SourcesList);
this.Invoke(new Action(() =>
{
dataGridView1.DataSource = RefreshSourcesList;
}));
}
}
}
}
}
private void rb_Serial_CheckedChanged(object sender, EventArgs e)
{
if (rb_Serial.Checked)
{
cb_SerialPort.Enabled = true;
tb_IP.Enabled = false;
nud_NetPort.Enabled = false;
}
else
{
cb_SerialPort.Enabled = false;
tb_IP.Enabled = true;
nud_NetPort.Enabled = true;
}
}
private void button1_Click(object sender, EventArgs e)
{
if (isStop)
{
//开启
isStop = false;
button1.Text = "停止";
reader?.InventoryStart();
}
else
{
//停止
isStop = true;
button1.Text = "读取";
reader?.InventoryStop();
}
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
_loginForm.Close();
}
private void button2_Click(object sender, EventArgs e)
{
//上报数据
if (SourcesList != null && SourcesList.Count > 0)
{
List<rfid_info> epcList = new List<rfid_info>();
SourcesList.SelectMany(t => t.epcList).ToList()
.ForEach(s => epcList.Add(new rfid_info()
{
RFID = s
}));
if (epcList.Count > 0)
{
{
if (button1.Text == "停止")
{
button1_Click(null, null);
}
var _res = HttpHelper.RfidInStore("", epcList);
MessageBox.Show(this, _res.Item2, "入库提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
SourcesList.Clear();
RefreshSourcesList = new ObservableCollection<scan_info>(SourcesList);
this.Invoke(new Action(() =>
{
dataGridView1.DataSource = RefreshSourcesList;
}));
}
}
}
}
private void cbb_warehouse_SelectedIndexChanged(object sender, EventArgs e)
{
LiteCaChe.SysConfig.WarehouseID = (cbb_warehouse.SelectedItem as store_info)?.id;
}
}
public enum DeviceStatus
{
未连接,
已连接
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class BaseJpWarehouse
{
public string id { get; set; }
public int? sort { get; set; }
public string name { get; set; }
public string location { get; set; }
public string locationDetail { get; set; }
public string orgizationId { get; set; }
public string phone { get; set; }
public DateTime createTime { get; set; }
public DateTime updateTime { get; set; }
public string updateUser { get; set; }
/// <summary>
/// 是否锁库,0:未锁库,1:锁库中
/// </summary>
public bool? isLocked { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class equ_info
{
public string id { get; set; }
public string code { get; set; }
public string name { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class order_equ
{
public string equCode { get; set; }
public int equRem { get; set; }
public int equCount { get; set; }
public int equUsed { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class order_info
{
public string id { get; set; }
public string warehouseId { get; set; }
public string orderCode { get; set; }
public string orgId { get; set; }
public string createTime { get; set; }
public bool? isWork { get; set; }
public string orderType { get; set; }
public int orderQuantity { get; set; }
public string equNames { get; set; }
public string borrowPolice { get; set; }
public string receiveWarehouseId { get; set; }
public string receiveWarehouseName { get; set; }
}
public class order_detail
{
public string id { get; set; }
public string equId { get; set; }
public string equName { get; set; }
public string equCode { get; set; }
public int equCount { get; set; }
public int equUsed { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class request_sign
{
public string appKey { get; set; } = string.Empty;
public string orgId { get; set; } = string.Empty;
public string version { get; set; } = "1.0";
public string timestamp { get; set; }
public string body { get; set; }
public string sign { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class respone<T>
{
public int code { get; set; }
public string msg { get; set; }
public T data { get; set; }
}
public class respone
{
public int code { get; set; }
public string msg { get; set; }
}
public class PagedList<T>
{
public int totalElements { get; set; }
public List<T> content { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class respone_upload
{
public int code { get; set; }
public string msg { get; set; }
public int timestamp { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class response_BoxMarkModel
{
public string id { get; set; }
public string createTime { get; set; }
public string epc { get; set; }
public string oneBoxNum { get; set; }
public string warehouseId { get; set; }
public string warehouseName { get; set; }
public string orgizationId { get; set; }
public string equipmentInfoId { get; set; }
public string equipmentDetailId { get; set; }
public string equipmentDetailName { get; set; }
public string equipmentDetailCode { get; set; }
public string sizeId { get; set; }
public string sizeName { get; set; }
public string sizeCode { get; set; }
public string sizeEpcType { get; set; }
public string supplierId { get; set; }
public string supplierCode { get; set; }
public string supplierName { get; set; }
public List<string> epcList { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class rfid_res
{
public string epc { get; set; }
public string name { get; set; }
public int currentState { get; set; }
public int safeLevel { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class scan_info : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public int equRem { get; set; }
public string equCode { get; set; }
public string equName { get; set; }
private int _scan_qty = 0;
public int scanQty
{
get { return _scan_qty; }
set
{
_scan_qty = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("scanQty"));
}
}
public int equCount { get; set; }
public List<string> epcList { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class soft_update
{
public string version2 { get; set; }
public int version { get; set; }
public string name { get; set; }
public string appCode { get; set; }
public string note { get; set; }
public string address { get; set; }
public string updateTime { get; set; }
public string fileMd5 { get; set; }
public bool isAutoUpdate { get; set; }
public string autoUpdateAddress { get; set; }
public string autoUpdateFileMd5 { get; set; }
public string autoUpdateVersion2 { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class store_info
{
public string id { get; set; }
public string name { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class sync_police
{
public string orgId { get; set; }
public string id { get; set; }
public string name { get; set; }
public string policeCode { get; set; }
public string photo { get; set; }
public DateTime udateTime { get; set; }
public DateTime createTime { get; set; }
public List<FingerInfo> fingerList { get; set; }
}
public class FingerInfo
{
public int fingerNum { get; set; }
public string fingerInfo { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiteChannelWinXP.Models
{
public class upload_info
{
public string orgId { get; set; }
public string warehouseId { get; set; }
/// <summary>
/// "当前出入库状态",//0出库,1入库
/// </summary>
public string currentState { get; set; }
public string policeId { get; set; } = string.Empty;
public string picUrl { get; set; }
public List<rfid_info> RFIDList { get; set; }
}
public class rfid_info
{
public string RFID { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
using LiteChannelWinXP.Commons;
namespace LiteChannelWinXP
{
static class Program
{
private static System.Threading.Mutex _mutex;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
_mutex = new System.Threading.Mutex(true, Process.GetCurrentProcess().ProcessName, out var ret);
if (!ret)
{
MessageBox.Show("已有另一个程序在运行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);//弹出提示信息
Environment.Exit(0);
}
LiteCaChe.SysConfig = LiteCaChe.LoadSystemStep();
if (LiteCaChe.SysConfig == null)
{
//MessageBox.Show("配置文件加载失败,请检查", "文件错误", MessageBoxButton.OK, MessageBoxImage.Error);
//Process.GetCurrentProcess().Kill();
MessageBox.Show("配置文件加载失败,创建默认配置文件");
LiteCaChe.SysConfig = new Config();
LiteCaChe.SaveSystemStep(LiteCaChe.SysConfig);
}
else
{
var update = HttpHelper.GetUpdate(LiteCaChe.SysConfig?.AppCode ?? "");
if (update == null)
{
}
else
{
if (Version.TryParse(update.version2, out var version) && version > new Version(LiteCaChe.SysConfig.AppVersion))
{
if (MessageBox.Show("检测到新版本,是否更新?", "更新提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
System.Diagnostics.Process.Start("explorer.exe", LiteCaChe.SysConfig.DomainUrl.TrimEnd('/') + "/" + update.address.TrimStart('/'));
Process.GetCurrentProcess().Kill();
}
else { }
}
}
}
//获取供应商
LiteCaChe.EquInfos = HttpHelper.GetEquInfos();
Application.Run(new Login());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LiteChannelWinXP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("LiteChannelWinXP")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("48900448-82f0-4876-9987-0aab845027d5")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace LiteChannelWinXP.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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("LiteChannelWinXP.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;
}
}
}
}
<?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>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace LiteChannelWinXP.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.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;
}
}
}
}
<?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>

namespace LiteChannelWinXP
{
partial class Setting
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.tb_domainUrl = new System.Windows.Forms.TextBox();
this.tb_loginUrl = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tb_appkey = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.tb_secretkey = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.cb_autoUpdate = new System.Windows.Forms.CheckBox();
this.cbb_autoUpdateTime = new System.Windows.Forms.ComboBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(22, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 0;
this.label1.Text = "接口域名:";
//
// tb_domainUrl
//
this.tb_domainUrl.Location = new System.Drawing.Point(93, 19);
this.tb_domainUrl.Name = "tb_domainUrl";
this.tb_domainUrl.Size = new System.Drawing.Size(219, 21);
this.tb_domainUrl.TabIndex = 1;
//
// tb_loginUrl
//
this.tb_loginUrl.Location = new System.Drawing.Point(93, 51);
this.tb_loginUrl.Name = "tb_loginUrl";
this.tb_loginUrl.Size = new System.Drawing.Size(219, 21);
this.tb_loginUrl.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(22, 54);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 2;
this.label2.Text = "登录接口:";
//
// tb_appkey
//
this.tb_appkey.Location = new System.Drawing.Point(93, 83);
this.tb_appkey.Name = "tb_appkey";
this.tb_appkey.Size = new System.Drawing.Size(219, 21);
this.tb_appkey.TabIndex = 5;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(22, 86);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(53, 12);
this.label3.TabIndex = 4;
this.label3.Text = "AppKey:";
//
// tb_secretkey
//
this.tb_secretkey.Location = new System.Drawing.Point(93, 116);
this.tb_secretkey.Name = "tb_secretkey";
this.tb_secretkey.Size = new System.Drawing.Size(219, 21);
this.tb_secretkey.TabIndex = 7;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(22, 119);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(71, 12);
this.label4.TabIndex = 6;
this.label4.Text = "SecretKey:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(22, 150);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(65, 12);
this.label5.TabIndex = 8;
this.label5.Text = "自动更新:";
//
// cb_autoUpdate
//
this.cb_autoUpdate.AutoSize = true;
this.cb_autoUpdate.Location = new System.Drawing.Point(93, 150);
this.cb_autoUpdate.Name = "cb_autoUpdate";
this.cb_autoUpdate.Size = new System.Drawing.Size(138, 16);
this.cb_autoUpdate.TabIndex = 9;
this.cb_autoUpdate.Text = "启用自动更新 时间:";
this.cb_autoUpdate.UseVisualStyleBackColor = true;
this.cb_autoUpdate.CheckedChanged += new System.EventHandler(this.cb_autoUpdate_CheckedChanged);
//
// cbb_autoUpdateTime
//
this.cbb_autoUpdateTime.FormattingEnabled = true;
this.cbb_autoUpdateTime.Items.AddRange(new object[] {
"0:00",
"1:00",
"2:00",
"3:00",
"4:00",
"5:00",
"6:00",
"7:00",
"8:00",
"9:00",
"10:00",
"11:00",
"12:00"});
this.cbb_autoUpdateTime.Location = new System.Drawing.Point(227, 148);
this.cbb_autoUpdateTime.Name = "cbb_autoUpdateTime";
this.cbb_autoUpdateTime.Size = new System.Drawing.Size(85, 20);
this.cbb_autoUpdateTime.TabIndex = 10;
//
// button1
//
this.button1.Location = new System.Drawing.Point(227, 415);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 11;
this.button1.Text = "保存";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Setting
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(328, 450);
this.Controls.Add(this.button1);
this.Controls.Add(this.cbb_autoUpdateTime);
this.Controls.Add(this.cb_autoUpdate);
this.Controls.Add(this.label5);
this.Controls.Add(this.tb_secretkey);
this.Controls.Add(this.label4);
this.Controls.Add(this.tb_appkey);
this.Controls.Add(this.label3);
this.Controls.Add(this.tb_loginUrl);
this.Controls.Add(this.label2);
this.Controls.Add(this.tb_domainUrl);
this.Controls.Add(this.label1);
this.Name = "Setting";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "设置";
this.Load += new System.EventHandler(this.Setting_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tb_domainUrl;
private System.Windows.Forms.TextBox tb_loginUrl;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox tb_appkey;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox tb_secretkey;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.CheckBox cb_autoUpdate;
private System.Windows.Forms.ComboBox cbb_autoUpdateTime;
private System.Windows.Forms.Button button1;
}
}
\ No newline at end of file
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;
namespace LiteChannelWinXP
{
public partial class Setting : Form
{
public Setting()
{
InitializeComponent();
}
private void Setting_Load(object sender, EventArgs e)
{
tb_domainUrl.Text = LiteCaChe.SysConfig.DomainUrl;
tb_loginUrl.Text = LiteCaChe.SysConfig.UserLogin;
tb_appkey.Text = LiteCaChe.SysConfig.AppKey;
tb_secretkey.Text = LiteCaChe.SysConfig.SecretKey;
cb_autoUpdate.Checked = LiteCaChe.SysConfig.IsAutoUpdate;
if (cb_autoUpdate.Checked)
{
cbb_autoUpdateTime.Enabled = true;
cbb_autoUpdateTime.SelectedIndex = LiteCaChe.SysConfig.AutoUpdateTime;
}
else
{
cbb_autoUpdateTime.Enabled = false;
}
}
private void button1_Click(object sender, EventArgs e)
{
LiteCaChe.SysConfig.DomainUrl = tb_domainUrl.Text;
LiteCaChe.SysConfig.UserLogin = tb_loginUrl.Text;
LiteCaChe.SysConfig.AppKey = tb_appkey.Text;
LiteCaChe.SysConfig.SecretKey = tb_secretkey.Text;
LiteCaChe.SysConfig.IsAutoUpdate = cb_autoUpdate.Checked;
if (cb_autoUpdate.Checked)
{
LiteCaChe.SysConfig.AutoUpdateTime = cbb_autoUpdateTime.SelectedIndex;
}
LiteCaChe.SaveSystemStep(LiteCaChe.SysConfig);
MessageBox.Show("保存成功");
this.Close();
}
private void cb_autoUpdate_CheckedChanged(object sender, EventArgs e)
{
if (cb_autoUpdate.Checked)
{
cbb_autoUpdateTime.Enabled = true;
}
else
{
cbb_autoUpdateTime.Enabled = false;
}
}
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net40" />
</packages>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论