資源簡介
一個自己寫的客流系統源碼,有興趣研究的同學拿去自己看看吧

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Configuration;
using?System.Data;
using?System.Data.SqlClient;
using?System.IO;
using?System.Net.Http;
using?System.Net.Http.Headers;
using?System.ServiceProcess;
using?System.Text;
using?System.Text.Regularexpressions;
using?System.Threading;
namespace?mrj
{
????public?partial?class?mrj?:?Servicebase
????{
????????public?mrj()
????????{
????????????InitializeComponent();
????????}
????????private?Thread?mt;
????????private?string?sqlstr;
????????protected?override?void?onstart(string[]?args)
????????{
????????????mt?=?new?Thread(MatchMothed);
????????????mt.Start();
????????}
????????private?string?url?=?“http://api.meirenji.cn/api/pos/import?shopId={0}&access_token={1}&appId={2}“;
????????private?void?MatchMothed()
????????{
????????????try
????????????{
????????????????sqlstr?=?ConfigurationManager.ConnectionStrings[“sqlstr“].ConnectionString.ToString();
????????????????System.Timers.Timer?tim?=?new?System.Timers.Timer(600000);
????????????????//System.Timers.Timer?tim?=?new?System.Timers.Timer(3595000);
????????????????tim.Elapsed?+=?Tim_Elapsed;
????????????????tim.Start();
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????Log(ExceptionToTxt(ex?“MatchMothed“));
????????????}
????????}
????????private?void?Tim_Elapsed(object?sender?System.Timers.ElapsedEventArgs?e)
????????{
????????????DateTime?dt?=?DateTime.Now;
????????????Log(string.Format(“開始{0}\r\n“dt.ToString(“yyyy-MM-dd?HH:mm:ss“)));
????????????//if?(dt.Hour?!=?2?&&?dt.Hour?!=?11||?dt.Hour?!=?14||?dt.Hour?!=?17?||?dt.Hour?!=?20)
????????????//????return;
????????????Dictionary?dic?=?new?Dictionary();
????????????//dic[2]?=?“5796“;//奧園
????????????//dic[3]?=?“5793“;//正佳
????????????//dic[7]?=?“6432“;//武漢
????????????//dic[9]?=?“6433“;//太原
????????????//dic[6]?=?“6431“;//英德
????????????//dic[4]?=?“6430“;//棗莊
????????????//dic[10]?=?“6435“;//龍山
????????????//dic[13]?=?“7425“;//西樵
????????????//dic[14]?=?“5797“;//瑪莎
????????????Regex?regex?=?new?Regex(@“{cy_id:(?\d+)mrj_id:(?\d+)}“);
????????????var?matches?=?regex.Matches(ConfigurationManager.AppSettings[“shop“]);
????????????foreach(Match?match?in?matches)
????????????{
????????????????dic.Add(int.Parse(match.Groups[“cy_id“].Value)?match.Groups[“mrj_id“].Value);
????????????}
????????????foreach?(var?m?in?dic)
????????????{
????????????????string?Json?=?GettradeDayData(m.KeyDateTime.Now);
????????????????try
????????????????{
????????????????????HttpClient?client?=?new?HttpClient();
????????????????????client.DefaultRequestHeaders.Accept.Add(new?MediaTypeWithQualityHeaderValue(“application/json“));
????????????????????var?httpContent?=?new?StringContent(Json?Encoding.UTF8);
????????????????????httpContent.Headers.ContentType?=?new?MediaTypeHeaderValue(“application/json“);
????????????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????174??2016-03-18?15:22??sert\App.config
?????文件???????2490??2016-03-18?10:31??sert\bin\Debug\InstallUtil.InstallLog
?????文件???????6656??2016-11-24?10:57??sert\bin\Debug\sert.exe
?????文件????????174??2016-03-18?15:22??sert\bin\Debug\sert.exe.config
?????文件???????7068??2016-03-18?10:31??sert\bin\Debug\sert.InstallLog
?????文件??????17920??2016-11-24?10:57??sert\bin\Debug\sert.pdb
?????文件?????180832??2012-07-10?12:07??sert\bin\Debug\System.Net.Http.dll
?????文件?????148528??2015-11-02?01:02??sert\bin\Debug\System.Net.Http.xm
?????文件?????????77??2016-03-18?10:30??sert\bin\Debug\卸載服務.bat
?????文件????????116??2016-03-18?10:18??sert\bin\Debug\添加服務.bat
?????文件???????1468??2016-09-05?15:53??sert\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????6942??2016-11-24?10:57??sert\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件?????????42??2019-01-28?19:31??sert\obj\Debug\sert.csproj.CoreCompileInputs.cache
?????文件???????1448??2016-11-24?10:57??sert\obj\Debug\sert.csproj.FileListAbsolute.txt
?????文件???????1008??2016-08-25?15:53??sert\obj\Debug\sert.csproj.GenerateResource.Cache
?????文件??????26861??2019-01-28?19:31??sert\obj\Debug\sert.csprojAssemblyReference.cache
?????文件???????7019??2016-08-25?15:53??sert\obj\Debug\sert.csprojResolveAssemblyReference.cache
?????文件???????6656??2016-11-24?10:57??sert\obj\Debug\sert.exe
?????文件??????17920??2016-11-24?10:57??sert\obj\Debug\sert.pdb
?????文件????????180??2016-08-25?15:53??sert\obj\Debug\sert.ProjectInstaller.resources
?????文件????????180??2016-08-25?15:53??sert\obj\Debug\sert.sert.resources
?????文件??????????0??2016-03-18?10:16??sert\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2016-03-18?10:16??sert\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2016-03-18?10:16??sert\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件????????446??2016-03-18?15:22??sert\Program.cs
?????文件????????439??2016-03-18?10:22??sert\ProjectInstaller.cs
?????文件???????2048??2016-03-18?10:22??sert\ProjectInstaller.Designer.cs
?????文件???????6416??2016-03-18?10:22??sert\ProjectInstaller.resx
?????文件???????1291??2016-03-18?15:22??sert\Properties\AssemblyInfo.cs
?????文件????????739??2016-03-18?15:22??sert\sert.cs
............此處省略188個文件信息
- 上一篇:ITU-T G.984.X
- 下一篇:MC8618使用說明
評論
共有 條評論