Skip to content

Commit 2143400

Browse files
committed
添加项目文件。
1 parent d238a49 commit 2143400

24 files changed

+3062
-0
lines changed

Login.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27703.2042
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Login", "Login\Login.vcxproj", "{81A03759-5A78-419E-B2B7-6010CB1E74E2}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{81A03759-5A78-419E-B2B7-6010CB1E74E2}.Debug|x64.ActiveCfg = Debug|x64
17+
{81A03759-5A78-419E-B2B7-6010CB1E74E2}.Debug|x64.Build.0 = Debug|x64
18+
{81A03759-5A78-419E-B2B7-6010CB1E74E2}.Debug|x86.ActiveCfg = Debug|Win32
19+
{81A03759-5A78-419E-B2B7-6010CB1E74E2}.Debug|x86.Build.0 = Debug|Win32
20+
{81A03759-5A78-419E-B2B7-6010CB1E74E2}.Release|x64.ActiveCfg = Release|x64
21+
{81A03759-5A78-419E-B2B7-6010CB1E74E2}.Release|x64.Build.0 = Release|x64
22+
{81A03759-5A78-419E-B2B7-6010CB1E74E2}.Release|x86.ActiveCfg = Release|Win32
23+
{81A03759-5A78-419E-B2B7-6010CB1E74E2}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {61E70EE7-4D43-4F66-B6E2-8C87AC7A3EB8}
30+
EndGlobalSection
31+
EndGlobal

Login/IconJlu.ico

75.7 KB
Binary file not shown.

Login/IconJluSm.ico

75.7 KB
Binary file not shown.

Login/LogUtil.cpp

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#include <windows.h>
2+
#include <tchar.h>
3+
#include <cstdio>
4+
#include <cstdarg>
5+
#include "LogUtil.h"
6+
7+
#ifdef UNICODE
8+
const WCHAR * szDebugPrefix = szDebugPrefixW;
9+
#elif
10+
const char * szDebugPrefix = szDebugPrefixA;
11+
#endif
12+
13+
static TCHAR szBuffer[1024];
14+
static TCHAR szB2[1024];
15+
static char strBuf[1024];
16+
static char strB2[1024];
17+
static SYSTEMTIME st;
18+
19+
void CDECL loge(const TCHAR * szFormat, ...) {
20+
va_list pArgList;
21+
va_start(pArgList, szFormat);
22+
#ifdef UNICODE
23+
_vsnwprintf_s(szBuffer, sizeof(szBuffer) / sizeof(TCHAR), szFormat, pArgList);
24+
#elif
25+
_vsnprintf_s(strBuf, sizeof(szBuffer) / sizeof(TCHAR), szFormat, pArgList);
26+
#endif
27+
va_end(pArgList);
28+
29+
GetLocalTime(&st);
30+
31+
wsprintf(szB2, TEXT("[ERROR] %02d:%02d:%02d.%03d [%d] %s %s\n"),
32+
// current time
33+
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,
34+
// process id
35+
GetCurrentProcessId(),
36+
// debug log
37+
szDebugPrefix, szBuffer);
38+
OutputDebugString(szB2);
39+
}
40+
41+
void CDECL logi(const TCHAR * szFormat, ...) {
42+
va_list pArgList;
43+
va_start(pArgList, szFormat);
44+
#ifdef UNICODE
45+
_vsnwprintf_s(szBuffer, sizeof(szBuffer) / sizeof(TCHAR), szFormat, pArgList);
46+
#elif
47+
_vsnprintf_s(strBuf, sizeof(szBuffer) / sizeof(TCHAR), szFormat, pArgList);
48+
#endif
49+
va_end(pArgList);
50+
51+
GetLocalTime(&st);
52+
53+
wsprintf(szB2, TEXT("[INFO] %02d:%02d:%02d.%03d [%d] %s %s\n"),
54+
// current time
55+
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,
56+
// process id
57+
GetCurrentProcessId(),
58+
// debug log
59+
szDebugPrefix, szBuffer);
60+
OutputDebugString(szB2);
61+
}
62+
63+
#ifndef _DEBUG
64+
void CDECL logd(const TCHAR * szFormat, ...) { }
65+
void CDECL logdA(const char * szFormat, ...) { }
66+
#else
67+
void CDECL logd(const TCHAR * szFormat, ...) {
68+
va_list pArgList;
69+
va_start(pArgList, szFormat);
70+
#ifdef UNICODE
71+
_vsnwprintf_s(szBuffer, sizeof(szBuffer) / sizeof(TCHAR), szFormat, pArgList);
72+
#elif
73+
_vsnprintf_s(strBuf, sizeof(szBuffer) / sizeof(TCHAR), szFormat, pArgList);
74+
#endif
75+
va_end(pArgList);
76+
77+
GetLocalTime(&st);
78+
79+
wsprintf(szB2, TEXT("[DEBUG] %02d:%02d:%02d.%03d [%d] %s %s\n"),
80+
// current time
81+
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,
82+
// process id
83+
GetCurrentProcessId(),
84+
// debug log
85+
szDebugPrefix, szBuffer);
86+
OutputDebugString(szB2);
87+
}
88+
89+
void CDECL logdA(const char * szFormat, ...) {
90+
va_list pArgList;
91+
va_start(pArgList, szFormat);
92+
_vsnprintf_s(strBuf, sizeof(strBuf) / sizeof(char), szFormat, pArgList);
93+
va_end(pArgList);
94+
95+
GetLocalTime(&st);
96+
97+
sprintf(strB2, "[INFO] %02d:%02d:%02d.%03d [%d] %s %s\n",
98+
// current time
99+
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,
100+
// process id
101+
GetCurrentProcessId(),
102+
// debug log
103+
szDebugPrefixA, strBuf);
104+
OutputDebugStringA(strB2);
105+
}
106+
#endif // _DEBUG
107+
108+
109+
110+
void CDECL logeA(const char * szFormat, ...) {
111+
va_list pArgList;
112+
va_start(pArgList, szFormat);
113+
_vsnprintf_s(strBuf, sizeof(strBuf) / sizeof(char), szFormat, pArgList);
114+
va_end(pArgList);
115+
116+
GetLocalTime(&st);
117+
118+
sprintf(strB2, "[ERROR] %02d:%02d:%02d.%03d [%d] %s %s\n",
119+
// current time
120+
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,
121+
// process id
122+
GetCurrentProcessId(),
123+
// debug log
124+
szDebugPrefixA, strBuf);
125+
OutputDebugStringA(strB2);
126+
}
127+
128+
void CDECL logiA(const char * szFormat, ...) {
129+
va_list pArgList;
130+
va_start(pArgList, szFormat);
131+
_vsnprintf_s(strBuf, sizeof(strBuf) / sizeof(char), szFormat, pArgList);
132+
va_end(pArgList);
133+
134+
GetLocalTime(&st);
135+
136+
sprintf(strB2, "[INFO] %02d:%02d:%02d.%03d [%d] %s %s\n",
137+
// current time
138+
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,
139+
// process id
140+
GetCurrentProcessId(),
141+
// debug log
142+
szDebugPrefixA, strBuf);
143+
OutputDebugStringA(strB2);
144+
}

Login/LogUtil.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef LOGUTIL_H
2+
#define LOGUTIL_H
3+
4+
void logd(const TCHAR * szFormat, ...);
5+
void logi(const TCHAR * szFormat, ...);
6+
void loge(const TCHAR * szFormat, ...);
7+
void logdA(const char * szFormat, ...);
8+
void logiA(const char * szFormat, ...);
9+
void logeA(const char * szFormat, ...);
10+
//void logdW(const TCHAR * szFormat, ...);
11+
//void logiW(const TCHAR * szFormat, ...);
12+
//void logeW(const TCHAR * szFormat, ...);
13+
extern const char * szDebugPrefixA;
14+
extern const WCHAR * szDebugPrefixW;
15+
16+
#endif // !LOGUTIL_H

Login/Login.rc

4.05 KB
Binary file not shown.

Login/Login.vcxproj

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>15.0</VCProjectVersion>
23+
<ProjectGuid>{81A03759-5A78-419E-B2B7-6010CB1E74E2}</ProjectGuid>
24+
<Keyword>Win32Proj</Keyword>
25+
<RootNamespace>Login</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v141</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v141</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v141</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v141</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<LinkIncremental>true</LinkIncremental>
75+
</PropertyGroup>
76+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
77+
<LinkIncremental>true</LinkIncremental>
78+
</PropertyGroup>
79+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
80+
<LinkIncremental>false</LinkIncremental>
81+
</PropertyGroup>
82+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
83+
<LinkIncremental>false</LinkIncremental>
84+
</PropertyGroup>
85+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
86+
<ClCompile>
87+
<WarningLevel>Level4</WarningLevel>
88+
<Optimization>Disabled</Optimization>
89+
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
90+
<ConformanceMode>true</ConformanceMode>
91+
</ClCompile>
92+
<Link>
93+
<GenerateDebugInformation>true</GenerateDebugInformation>
94+
<SubSystem>Windows</SubSystem>
95+
<AdditionalManifestDependencies>type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'</AdditionalManifestDependencies>
96+
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
97+
</Link>
98+
</ItemDefinitionGroup>
99+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
100+
<ClCompile>
101+
<WarningLevel>Level3</WarningLevel>
102+
<Optimization>Disabled</Optimization>
103+
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104+
<ConformanceMode>true</ConformanceMode>
105+
</ClCompile>
106+
<Link>
107+
<GenerateDebugInformation>true</GenerateDebugInformation>
108+
<SubSystem>Windows</SubSystem>
109+
</Link>
110+
</ItemDefinitionGroup>
111+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
112+
<ClCompile>
113+
<WarningLevel>Level3</WarningLevel>
114+
<Optimization>MaxSpeed</Optimization>
115+
<FunctionLevelLinking>true</FunctionLevelLinking>
116+
<IntrinsicFunctions>true</IntrinsicFunctions>
117+
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118+
<ConformanceMode>true</ConformanceMode>
119+
</ClCompile>
120+
<Link>
121+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
122+
<OptimizeReferences>true</OptimizeReferences>
123+
<GenerateDebugInformation>true</GenerateDebugInformation>
124+
<SubSystem>Windows</SubSystem>
125+
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
126+
<AdditionalManifestDependencies>type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*';%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
127+
</Link>
128+
</ItemDefinitionGroup>
129+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
130+
<ClCompile>
131+
<WarningLevel>Level3</WarningLevel>
132+
<Optimization>MaxSpeed</Optimization>
133+
<FunctionLevelLinking>true</FunctionLevelLinking>
134+
<IntrinsicFunctions>true</IntrinsicFunctions>
135+
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
136+
<ConformanceMode>true</ConformanceMode>
137+
</ClCompile>
138+
<Link>
139+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
140+
<OptimizeReferences>true</OptimizeReferences>
141+
<GenerateDebugInformation>true</GenerateDebugInformation>
142+
<SubSystem>Windows</SubSystem>
143+
</Link>
144+
</ItemDefinitionGroup>
145+
<ItemGroup>
146+
<ClCompile Include="dogcom\auth.cpp" />
147+
<ClCompile Include="dogcom\configparse.cpp" />
148+
<ClCompile Include="dogcom\keepalive.cpp" />
149+
<ClCompile Include="dogcom\login.cpp" />
150+
<ClCompile Include="dogcom\md4.cpp" />
151+
<ClCompile Include="dogcom\md5.cpp" />
152+
<ClCompile Include="dogcom\sha1.cpp" />
153+
<ClCompile Include="WinMain.cpp" />
154+
<ClCompile Include="LogUtil.cpp" />
155+
</ItemGroup>
156+
<ItemGroup>
157+
<ClInclude Include="dogcom\auth.h" />
158+
<ClInclude Include="dogcom\configparse.h" />
159+
<ClInclude Include="dogcom\keepalive.h" />
160+
<ClInclude Include="dogcom\login.h" />
161+
<ClInclude Include="dogcom\md4.h" />
162+
<ClInclude Include="dogcom\md5.h" />
163+
<ClInclude Include="dogcom\sha1.h" />
164+
<ClInclude Include="LogUtil.h" />
165+
<ClInclude Include="resource.h" />
166+
</ItemGroup>
167+
<ItemGroup>
168+
<ResourceCompile Include="Login.rc" />
169+
</ItemGroup>
170+
<ItemGroup>
171+
<Image Include="IconJlu.ico" />
172+
<Image Include="IconJluSm.ico" />
173+
</ItemGroup>
174+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
175+
<ImportGroup Label="ExtensionTargets">
176+
</ImportGroup>
177+
</Project>

0 commit comments

Comments
 (0)