91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 70KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-09
  • 語言: 其他
  • 標簽: 多線程??UDP??儲存??

資源簡介

多線程UDP接收到數據,并對數據進行存儲

資源截圖

代碼片段和文件信息

using?System;
using?System.Text;
using?System.IO;
using?System.Net;
using?System.Net.Sockets;
using?System.Threading;

namespace?Gps.MonitorService
{
????public?class?MonitorServer
????{
?????????private?static?UdpClient?listener;
?????????private?IPAddress?IPAddr;
?????????private?const?int?port?=?8080;
?????????private?Thread?listenerThread?=?null;

?????????public?MonitorServer(string?IP)
?????????{
?????????????this.IPAddr?=?IPAddress.Parse(IP);
?????????}

?????????private?static?void?WriteLog(string?ex)
?????????{
?????????????string?path?=?@System.Environment.CurrentDirectory;

?????????????try
?????????????{
?????????????????if?(Directory.Exists(path))
?????????????????{
?????????????????????string?filename?=?path?+?“Error.txt“;
?????????????????????FileInfo?myfile?=?new?FileInfo(filename);
?????????????????????if?(!myfile.Exists)
?????????????????????{
?????????????????????????FileStream?newfile?=?myfile.OpenWrite();
?????????????????????????newfile.Close();
?????????????????????}

?????????????????????StreamWriter?write?=?new?StreamWriter(filename?true);
?????????????????????write.WriteLine(ex);
?????????????????????write.Flush();
?????????????????????write.Close();
?????????????????}
?????????????????else
?????????????????{
?????????????????????Directory.CreateDirectory(path);
?????????????????????string?filename?=?path?+?“Error.txt“;

?????????????????????FileStream?newfile?=?File.Create(filename);
?????????????????????newfile.Flush();
?????????????????????newfile.Close();
?????????????????????StreamWriter?write?=?new?StreamWriter(filename);
?????????????????????write.WriteLine(ex);
?????????????????????write.Flush();
?????????????????????write.Close();
?????????????????}
?????????????}
?????????????catch?(Exception?ex1)
?????????????{
?????????????????
?????????????}
?????????}

?????????private?static?void?SaveMessage(string?mgs)
?????????{
?????????????string?path?=?@System.Environment.CurrentDirectory;

?????????????try
?????????????{
?????????????????if?(Directory.Exists(path))
?????????????????{
?????????????????????string?filename?=?path?+?“Message.txt“;
?????????????????????FileInfo?myfile?=?new?FileInfo(filename);
?????????????????????if?(!myfile.Exists)
?????????????????????{
?????????????????????????FileStream?newfile?=?myfile.OpenWrite();
?????????????????????????newfile.Close();
?????????????????????}

?????????????????????StreamWriter?write?=?new?StreamWriter(filename?true);
?????????????????????write.WriteLine(mgs);
?????????????????????write.Flush();
?????????????????????write.Close();
?????????????????}
?????????????????else
?????????????????{
?????????????????????Directory.CreateDirectory(path);
?????????????????????string?filename?=?path?+?“Message.txt“;

?????????????????????FileStream?newfile?=?File.Create(filename);
?????????????????????newfile.Flush();
?????????????????????newfile.Close();
?????????????????????StreamWrit

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1426??2016-08-04?16:17??Monitor\Backup\GPS_Monitor.sln

????..A..H.?????39424??2016-08-28?18:07??Monitor\Backup\GPS_Monitor.suo

?????文件???????5052??2016-08-28?17:48??Monitor\Backup\WindowsServer\MonitorServer.cs

?????文件???????2515??2016-08-04?16:33??Monitor\Backup\WindowsServer\MonitorServer.csproj

?????文件???????1358??2016-08-01?14:41??Monitor\Backup\WindowsServer\Properties\AssemblyInfo.cs

?????文件????????544??2016-08-01?14:42??Monitor\Backup\WindowsService1\MonitorService.cs

?????文件???????2776??2016-08-01?14:48??Monitor\Backup\WindowsService1\MonitorService.csproj

?????文件???????1099??2016-08-01?14:43??Monitor\Backup\WindowsService1\MonitorService.Designer.cs

?????文件????????518??2016-08-01?14:44??Monitor\Backup\WindowsService1\Program.cs

?????文件???????1362??2016-08-01?14:36??Monitor\Backup\WindowsService1\Properties\AssemblyInfo.cs

?????文件???????1426??2016-08-30?15:27??Monitor\GPS_Monitor.sln

????..A..H.?????47616??2016-09-11?18:09??Monitor\GPS_Monitor.suo

?????文件???????3799??2016-08-30?15:27??Monitor\UpgradeLog.xml

?????文件???????4096??2016-08-01?14:48??Monitor\WindowsServer\bin\Debug\ClassLibrary1.dll

?????文件???????7680??2016-08-01?14:48??Monitor\WindowsServer\bin\Debug\ClassLibrary1.pdb

?????文件???????6144??2016-09-11?17:46??Monitor\WindowsServer\bin\Debug\MonitorService.dll

?????文件??????17920??2016-09-11?17:46??Monitor\WindowsServer\bin\Debug\MonitorService.pdb

?????文件???????5052??2016-08-28?17:48??Monitor\WindowsServer\MonitorServer.cs

?????文件???????4176??2016-08-30?15:27??Monitor\WindowsServer\MonitorServer.csproj

?????文件????????452??2016-08-30?15:27??Monitor\WindowsServer\MonitorServer.csproj.user

?????文件????????538??2016-08-01?14:42??Monitor\WindowsServer\obj\Debug\ClassLibrary1.csproj.FileListAbsolute.txt

?????文件???????4096??2016-08-01?14:48??Monitor\WindowsServer\obj\Debug\ClassLibrary1.dll

?????文件???????5791??2016-09-11?17:46??Monitor\WindowsServer\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

?????文件???????1428??2016-09-11?17:46??Monitor\WindowsServer\obj\Debug\MonitorServer.csproj.FileListAbsolute.txt

?????文件???????6144??2016-09-11?17:46??Monitor\WindowsServer\obj\Debug\MonitorService.dll

?????文件??????17920??2016-09-11?17:46??Monitor\WindowsServer\obj\Debug\MonitorService.pdb

?????文件???????4096??2016-08-04?16:24??Monitor\WindowsServer\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

?????文件???????1358??2016-08-01?14:41??Monitor\WindowsServer\Properties\AssemblyInfo.cs

?????文件???????5120??2016-09-11?17:45??Monitor\WindowsService1\bin\Debug\WindowsService1.exe

?????文件??????19968??2016-09-11?17:45??Monitor\WindowsService1\bin\Debug\WindowsService1.pdb

............此處省略46個文件信息

評論

共有 條評論