mirror of
https://github.com/yuanyuanxiang/SimpleRemoter.git
synced 2026-01-23 15:53:10 +08:00
Release v1.2.3
This commit is contained in:
Binary file not shown.
@@ -29,7 +29,12 @@ public:
|
||||
virtual std::string GetPeerName() const override
|
||||
{
|
||||
char client_ip[INET_ADDRSTRLEN];
|
||||
#if (defined(_WIN32_WINNT) && _WIN32_WINNT <= 0x0501)
|
||||
strncpy(client_ip, inet_ntoa(clientAddr.sin_addr), INET_ADDRSTRLEN - 1);
|
||||
client_ip[INET_ADDRSTRLEN - 1] = '\0';
|
||||
#else
|
||||
inet_ntop(AF_INET, &clientAddr.sin_addr, client_ip, INET_ADDRSTRLEN);
|
||||
#endif
|
||||
return client_ip;
|
||||
}
|
||||
virtual int GetPort() const override
|
||||
|
||||
@@ -731,7 +731,12 @@ public:
|
||||
virtual std::string GetPeerName() const override
|
||||
{
|
||||
char client_ip[INET_ADDRSTRLEN];
|
||||
#if (defined(_WIN32_WINNT) && _WIN32_WINNT <= 0x0501)
|
||||
strncpy(client_ip, inet_ntoa(clientAddr.sin_addr), INET_ADDRSTRLEN - 1);
|
||||
client_ip[INET_ADDRSTRLEN - 1] = '\0';
|
||||
#else
|
||||
inet_ntop(AF_INET, &clientAddr.sin_addr, client_ip, INET_ADDRSTRLEN);
|
||||
#endif
|
||||
return client_ip;
|
||||
}
|
||||
virtual int GetPort() const override
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <wincrypt.h>
|
||||
#include <iostream>
|
||||
#include "common/commands.h"
|
||||
#include <algorithm>
|
||||
|
||||
#pragma comment(lib, "Advapi32.lib")
|
||||
#pragma comment(lib, "bcrypt.lib")
|
||||
@@ -85,8 +86,8 @@ std::string execCommand(const char* cmd)
|
||||
SAFE_CLOSE_HANDLE(pi.hThread);
|
||||
|
||||
// 去除换行符和空格
|
||||
result.erase(remove(result.begin(), result.end(), '\n'), result.end());
|
||||
result.erase(remove(result.begin(), result.end(), '\r'), result.end());
|
||||
result.erase(std::remove(result.begin(), result.end(), '\n'), result.end());
|
||||
result.erase(std::remove(result.begin(), result.end(), '\r'), result.end());
|
||||
|
||||
// 返回命令的输出结果
|
||||
return result.empty() ? "ERROR" : result;
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(SolutionDir)Bin\Plugins\$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
Reference in New Issue
Block a user