Skip to content

Commit 6b40acc

Browse files
committed
02_11 Select查询机制
1 parent b7881fc commit 6b40acc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3795
-1
lines changed

Test02_10Client/Test02_10Client.sln

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test02_10Client", "Test02_10Client\Test02_10Client.vcxproj", "{029480AB-932D-4305-8DF4-652711E14173}"
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+
{029480AB-932D-4305-8DF4-652711E14173}.Debug|x64.ActiveCfg = Debug|x64
17+
{029480AB-932D-4305-8DF4-652711E14173}.Debug|x64.Build.0 = Debug|x64
18+
{029480AB-932D-4305-8DF4-652711E14173}.Debug|x86.ActiveCfg = Debug|Win32
19+
{029480AB-932D-4305-8DF4-652711E14173}.Debug|x86.Build.0 = Debug|Win32
20+
{029480AB-932D-4305-8DF4-652711E14173}.Release|x64.ActiveCfg = Release|x64
21+
{029480AB-932D-4305-8DF4-652711E14173}.Release|x64.Build.0 = Release|x64
22+
{029480AB-932D-4305-8DF4-652711E14173}.Release|x86.ActiveCfg = Release|Win32
23+
{029480AB-932D-4305-8DF4-652711E14173}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="14.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+
<ProjectGuid>{029480AB-932D-4305-8DF4-652711E14173}</ProjectGuid>
23+
<Keyword>Win32Proj</Keyword>
24+
<RootNamespace>Test02_10Client</RootNamespace>
25+
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
26+
</PropertyGroup>
27+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
29+
<ConfigurationType>Application</ConfigurationType>
30+
<UseDebugLibraries>true</UseDebugLibraries>
31+
<PlatformToolset>v140</PlatformToolset>
32+
<CharacterSet>Unicode</CharacterSet>
33+
</PropertyGroup>
34+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
35+
<ConfigurationType>Application</ConfigurationType>
36+
<UseDebugLibraries>false</UseDebugLibraries>
37+
<PlatformToolset>v140</PlatformToolset>
38+
<WholeProgramOptimization>true</WholeProgramOptimization>
39+
<CharacterSet>Unicode</CharacterSet>
40+
</PropertyGroup>
41+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
42+
<ConfigurationType>Application</ConfigurationType>
43+
<UseDebugLibraries>true</UseDebugLibraries>
44+
<PlatformToolset>v140</PlatformToolset>
45+
<CharacterSet>Unicode</CharacterSet>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
48+
<ConfigurationType>Application</ConfigurationType>
49+
<UseDebugLibraries>false</UseDebugLibraries>
50+
<PlatformToolset>v140</PlatformToolset>
51+
<WholeProgramOptimization>true</WholeProgramOptimization>
52+
<CharacterSet>Unicode</CharacterSet>
53+
</PropertyGroup>
54+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
55+
<ImportGroup Label="ExtensionSettings">
56+
</ImportGroup>
57+
<ImportGroup Label="Shared">
58+
</ImportGroup>
59+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
60+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61+
</ImportGroup>
62+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
63+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64+
</ImportGroup>
65+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
66+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
67+
</ImportGroup>
68+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
69+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
70+
</ImportGroup>
71+
<PropertyGroup Label="UserMacros" />
72+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
73+
<LinkIncremental>true</LinkIncremental>
74+
</PropertyGroup>
75+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
76+
<LinkIncremental>true</LinkIncremental>
77+
</PropertyGroup>
78+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
79+
<LinkIncremental>false</LinkIncremental>
80+
</PropertyGroup>
81+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
82+
<LinkIncremental>false</LinkIncremental>
83+
</PropertyGroup>
84+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
85+
<ClCompile>
86+
<PrecompiledHeader>
87+
</PrecompiledHeader>
88+
<WarningLevel>Level3</WarningLevel>
89+
<Optimization>Disabled</Optimization>
90+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
91+
</ClCompile>
92+
<Link>
93+
<SubSystem>Console</SubSystem>
94+
<GenerateDebugInformation>true</GenerateDebugInformation>
95+
</Link>
96+
</ItemDefinitionGroup>
97+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
98+
<ClCompile>
99+
<PrecompiledHeader>
100+
</PrecompiledHeader>
101+
<WarningLevel>Level3</WarningLevel>
102+
<Optimization>Disabled</Optimization>
103+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104+
</ClCompile>
105+
<Link>
106+
<SubSystem>Console</SubSystem>
107+
<GenerateDebugInformation>true</GenerateDebugInformation>
108+
</Link>
109+
</ItemDefinitionGroup>
110+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
111+
<ClCompile>
112+
<WarningLevel>Level3</WarningLevel>
113+
<PrecompiledHeader>
114+
</PrecompiledHeader>
115+
<Optimization>MaxSpeed</Optimization>
116+
<FunctionLevelLinking>true</FunctionLevelLinking>
117+
<IntrinsicFunctions>true</IntrinsicFunctions>
118+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
119+
</ClCompile>
120+
<Link>
121+
<SubSystem>Console</SubSystem>
122+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
123+
<OptimizeReferences>true</OptimizeReferences>
124+
<GenerateDebugInformation>true</GenerateDebugInformation>
125+
</Link>
126+
</ItemDefinitionGroup>
127+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
128+
<ClCompile>
129+
<WarningLevel>Level3</WarningLevel>
130+
<PrecompiledHeader>
131+
</PrecompiledHeader>
132+
<Optimization>MaxSpeed</Optimization>
133+
<FunctionLevelLinking>true</FunctionLevelLinking>
134+
<IntrinsicFunctions>true</IntrinsicFunctions>
135+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
136+
</ClCompile>
137+
<Link>
138+
<SubSystem>Console</SubSystem>
139+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
140+
<OptimizeReferences>true</OptimizeReferences>
141+
<GenerateDebugInformation>true</GenerateDebugInformation>
142+
</Link>
143+
</ItemDefinitionGroup>
144+
<ItemGroup>
145+
<ClInclude Include="afos\AfCd.h" />
146+
<ClInclude Include="afos\AfFineClock.h" />
147+
<ClInclude Include="afos\AfMutex.h" />
148+
<ClInclude Include="afos\AfSem.h" />
149+
<ClInclude Include="afos\AfSocket.h" />
150+
<ClInclude Include="afos\AfThread.h" />
151+
</ItemGroup>
152+
<ItemGroup>
153+
<ClCompile Include="afos\AfCd_Win32.cpp" />
154+
<ClCompile Include="afos\AfFineClock_Win32.cpp" />
155+
<ClCompile Include="afos\AfMutex_Linux.cpp" />
156+
<ClCompile Include="afos\AfMutex_Win32.cpp" />
157+
<ClCompile Include="afos\AfSem_Linux.cpp" />
158+
<ClCompile Include="afos\AfSem_Win32.cpp" />
159+
<ClCompile Include="afos\AfSocket.cpp" />
160+
<ClCompile Include="afos\AfThread_Linux.cpp" />
161+
<ClCompile Include="afos\AfThread_Win32.cpp" />
162+
<ClCompile Include="main.cpp" />
163+
</ItemGroup>
164+
<ItemGroup>
165+
<Text Include="afos\ChangeLog.txt" />
166+
</ItemGroup>
167+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
168+
<ImportGroup Label="ExtensionTargets">
169+
</ImportGroup>
170+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="源文件">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="头文件">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="资源文件">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
<Filter Include="afos">
17+
<UniqueIdentifier>{2336f32b-e042-4762-81ba-45e67eb4872b}</UniqueIdentifier>
18+
</Filter>
19+
</ItemGroup>
20+
<ItemGroup>
21+
<ClInclude Include="afos\AfCd.h">
22+
<Filter>afos</Filter>
23+
</ClInclude>
24+
<ClInclude Include="afos\AfFineClock.h">
25+
<Filter>afos</Filter>
26+
</ClInclude>
27+
<ClInclude Include="afos\AfMutex.h">
28+
<Filter>afos</Filter>
29+
</ClInclude>
30+
<ClInclude Include="afos\AfSem.h">
31+
<Filter>afos</Filter>
32+
</ClInclude>
33+
<ClInclude Include="afos\AfSocket.h">
34+
<Filter>afos</Filter>
35+
</ClInclude>
36+
<ClInclude Include="afos\AfThread.h">
37+
<Filter>afos</Filter>
38+
</ClInclude>
39+
</ItemGroup>
40+
<ItemGroup>
41+
<ClCompile Include="afos\AfCd_Win32.cpp">
42+
<Filter>afos</Filter>
43+
</ClCompile>
44+
<ClCompile Include="afos\AfFineClock_Win32.cpp">
45+
<Filter>afos</Filter>
46+
</ClCompile>
47+
<ClCompile Include="afos\AfMutex_Linux.cpp">
48+
<Filter>afos</Filter>
49+
</ClCompile>
50+
<ClCompile Include="afos\AfMutex_Win32.cpp">
51+
<Filter>afos</Filter>
52+
</ClCompile>
53+
<ClCompile Include="afos\AfSem_Linux.cpp">
54+
<Filter>afos</Filter>
55+
</ClCompile>
56+
<ClCompile Include="afos\AfSem_Win32.cpp">
57+
<Filter>afos</Filter>
58+
</ClCompile>
59+
<ClCompile Include="afos\AfSocket.cpp">
60+
<Filter>afos</Filter>
61+
</ClCompile>
62+
<ClCompile Include="afos\AfThread_Linux.cpp">
63+
<Filter>afos</Filter>
64+
</ClCompile>
65+
<ClCompile Include="afos\AfThread_Win32.cpp">
66+
<Filter>afos</Filter>
67+
</ClCompile>
68+
<ClCompile Include="main.cpp">
69+
<Filter>源文件</Filter>
70+
</ClCompile>
71+
</ItemGroup>
72+
<ItemGroup>
73+
<Text Include="afos\ChangeLog.txt">
74+
<Filter>afos</Filter>
75+
</Text>
76+
</ItemGroup>
77+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
#ifndef _AF_CD_H
3+
#define _AF_CD_H
4+
5+
/* AfCd
6+
用于设置进程的"当前目录"
7+
8+
作者:邵发
9+
版本:2016-01-05
10+
最新版本请在官网 http://afanihao.cn 上获取
11+
*/
12+
13+
#include <string>
14+
using std::string;
15+
16+
class AfCd
17+
{
18+
public:
19+
// 得到exe文件所在的目录
20+
static string exeLocation(char seperator='\\');
21+
22+
// 切换到目标位置
23+
static void cd(const string& targetDir);
24+
25+
// 切换到exe所有的位置
26+
static void cd();
27+
};
28+
29+
#endif
30+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
#ifdef _WIN32
3+
4+
#include <stdio.h>
5+
#include <stdlib.h>
6+
#include <string.h>
7+
8+
#include <windows.h>
9+
#include "AfCd.h"
10+
11+
string AfCd::exeLocation(char seperator)
12+
{
13+
// 得到exe文件的全路径
14+
char buf[512]={0};
15+
GetModuleFileNameA(NULL, buf, 512);
16+
17+
// 替换分隔符
18+
string filePath = buf;
19+
if(seperator != '\\') //windows下默认是反斜线
20+
{
21+
for(int i=0; i<filePath.length(); i++)
22+
{
23+
if(filePath[i] == '\\')
24+
filePath[i] = seperator;
25+
}
26+
}
27+
28+
// 去除文件名,得到纯目录
29+
int pos = filePath.rfind(seperator);
30+
string cd = filePath.substr(0, pos + 1);
31+
return cd;
32+
}
33+
34+
void AfCd::cd(const string& dir)
35+
{
36+
SetCurrentDirectoryA(dir.c_str());
37+
}
38+
39+
void AfCd::cd()
40+
{
41+
string where = exeLocation('\\');
42+
cd(where);
43+
}
44+
45+
46+
#endif
47+
48+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#ifndef _AF_FINE_CLOCK_H
2+
#define _AF_FINE_CLOCK_H
3+
4+
5+
/* AfFineClock
6+
毫秒级时钟
7+
8+
作者 邵发
9+
官网 http://afanihao.cn
10+
版本:2016-01-05
11+
此代码是 C/C++学习指南(补充篇)-Windows API 的官方代码,最新版本请到官网下载
12+
13+
*/
14+
15+
16+
class AfFineClock
17+
{
18+
public:
19+
AfFineClock();
20+
21+
// 返回当前时间(从0开始,单位毫秒)
22+
unsigned int now();
23+
24+
// 重置时钟,并返回自上一次重置以来的时间长度
25+
unsigned int reset();
26+
27+
private:
28+
unsigned int m_startPoint;
29+
};
30+
31+
#endif
32+

0 commit comments

Comments
 (0)