Răsfoiți Sursa

服务进程;

scbc.sat2 5 ani în urmă
părinte
comite
7a9ba7bce0

+ 46 - 0
SATService/SATService.sln

@@ -0,0 +1,46 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SATService", "SATService\SATService.vcproj", "{47EA9E19-826D-436E-9E97-5E1824F8E6EC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SATHTTP", "..\SATHTTP\SATHTTP\SATHTTP.vcproj", "{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RunPython", "..\RunPython\RunPython\RunPython.vcproj", "{92FC4676-AAFC-4568-93EE-849029E5381D}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		DebugEXE|Win32 = DebugEXE|Win32
+		DeubgExe|Win32 = DeubgExe|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{47EA9E19-826D-436E-9E97-5E1824F8E6EC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{47EA9E19-826D-436E-9E97-5E1824F8E6EC}.Debug|Win32.Build.0 = Debug|Win32
+		{47EA9E19-826D-436E-9E97-5E1824F8E6EC}.DebugEXE|Win32.ActiveCfg = Debug|Win32
+		{47EA9E19-826D-436E-9E97-5E1824F8E6EC}.DebugEXE|Win32.Build.0 = Debug|Win32
+		{47EA9E19-826D-436E-9E97-5E1824F8E6EC}.DeubgExe|Win32.ActiveCfg = Debug|Win32
+		{47EA9E19-826D-436E-9E97-5E1824F8E6EC}.DeubgExe|Win32.Build.0 = Debug|Win32
+		{47EA9E19-826D-436E-9E97-5E1824F8E6EC}.Release|Win32.ActiveCfg = Release|Win32
+		{47EA9E19-826D-436E-9E97-5E1824F8E6EC}.Release|Win32.Build.0 = Release|Win32
+		{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}.Debug|Win32.Build.0 = Debug|Win32
+		{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}.DebugEXE|Win32.ActiveCfg = DebugEXE|Win32
+		{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}.DebugEXE|Win32.Build.0 = DebugEXE|Win32
+		{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}.DeubgExe|Win32.ActiveCfg = DebugEXE|Win32
+		{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}.DeubgExe|Win32.Build.0 = DebugEXE|Win32
+		{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}.Release|Win32.ActiveCfg = Release|Win32
+		{E3798CCE-0392-42B7-A1D0-0D726BA23CA4}.Release|Win32.Build.0 = Release|Win32
+		{92FC4676-AAFC-4568-93EE-849029E5381D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{92FC4676-AAFC-4568-93EE-849029E5381D}.Debug|Win32.Build.0 = Debug|Win32
+		{92FC4676-AAFC-4568-93EE-849029E5381D}.DebugEXE|Win32.ActiveCfg = Debug|Win32
+		{92FC4676-AAFC-4568-93EE-849029E5381D}.DebugEXE|Win32.Build.0 = Debug|Win32
+		{92FC4676-AAFC-4568-93EE-849029E5381D}.DeubgExe|Win32.ActiveCfg = DeubgExe|Win32
+		{92FC4676-AAFC-4568-93EE-849029E5381D}.DeubgExe|Win32.Build.0 = DeubgExe|Win32
+		{92FC4676-AAFC-4568-93EE-849029E5381D}.Release|Win32.ActiveCfg = Release|Win32
+		{92FC4676-AAFC-4568-93EE-849029E5381D}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 40 - 0
SATService/SATService/ReadMe.txt

@@ -0,0 +1,40 @@
+========================================================================
+    控制台应用程序:SATService 项目概述
+========================================================================
+
+应用程序向导已为您创建了此 SATService 应用程序。
+
+本文件概要介绍组成 SATService 应用程序的
+的每个文件的内容。
+
+
+SATService.vcproj
+    这是使用应用程序向导生成的 VC++ 项目的主项目文件,
+    其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
+
+SATService.cpp
+    这是主应用程序源文件。
+
+/////////////////////////////////////////////////////////////////////////////
+应用程序向导创建了下列资源:
+
+SATService.rc
+这是程序使用的所有 Microsoft Windows 资源的列表。它包括 RES 子目录中存储的图标、位图和光标。
+此文件可以直接在 Microsoft Visual C++ 中进行编辑。
+
+Resource.h
+    这是标准头文件,可用于定义新的资源 ID。
+    Microsoft Visual C++ 将读取并更新此文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他标准文件:
+
+StdAfx.h, StdAfx.cpp
+    这些文件用于生成名为 SATService.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他注释:
+
+应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
+
+/////////////////////////////////////////////////////////////////////////////

+ 17 - 0
SATService/SATService/Resource.h

@@ -0,0 +1,17 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by SATService.rc
+//
+
+#define IDS_APP_TITLE			103
+
+// жÔÏóµÄÏÂÒ»×éĬÈÏÖµ
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE	101
+#define _APS_NEXT_COMMAND_VALUE		40001
+#define _APS_NEXT_CONTROL_VALUE		1000
+#define _APS_NEXT_SYMED_VALUE		101
+#endif
+#endif

+ 357 - 0
SATService/SATService/SATService.cpp

@@ -0,0 +1,357 @@
+// SATService.cpp : 定义控制台应用程序的入口点。
+//
+
+#include "stdafx.h"
+#include "SATService.h"
+#include <direct.h>
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+
+__if_not_exists(NotifyJobStart)
+{
+	int NotifyJobStart(std::string url, const SATParameters::STNotifyJobStartReq &stNotifyJobStartReq, SATParameters::STNotifyJobStartResp &stNotifyJobStartResp) throw()
+	{
+		return SetResult(url, stNotifyJobStartReq, stNotifyJobStartResp);
+	}
+}
+
+__if_not_exists(ProcessJob)
+{
+	int ProcessJob(std::string url, const SATParameters::STJobProcessReq &stJobProcessReq, SATParameters::STJobProcessResp &stJobProcessResp) throw()
+	{
+		return SetResultList(url, stJobProcessReq, stJobProcessResp);
+	}
+}
+// 唯一的应用程序对象
+
+CWinApp theApp;
+
+using namespace std;
+
+bool MKDIR(LPCTSTR dir) 
+{
+	//////////////////////////////////////////////////////////////////////////
+	// 创建目录;
+	int nleft = 0;
+	int nIndex = -1;
+	std::string strdir = dir;
+	strdir = strdir.substr(0, strdir.find_last_of(_T("\\")));
+
+	if (strdir.at(strdir.size() - 1) != _T('\\'))
+		strdir.append(_T("\\"));
+
+	// 共享路径和硬盘盘符;
+	if (_tcscmp(strdir.substr(0, 2).c_str(), _T("\\\\")) == 0)
+		nleft = strdir.find_first_of(_T("\\"), 2) + 1;	// 去除共享主机名;
+	else if (strdir.at(2) == _T('\\'))
+		nleft = 3;
+
+	do
+	{
+		nIndex = strdir.substr(nleft, -1).find_first_of(_T("\\"));
+
+		if (nIndex != string::npos)
+		{
+			if (_mkdir(strdir.substr(0, nIndex + nleft).c_str()) == -1 && (errno != EEXIST))
+			{
+				return false;
+			}
+
+			nleft += nIndex + 1;
+		}
+	} while (nIndex != -1);
+
+	return true;
+};
+
+int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
+{
+	int nRetCode = 0;
+
+	// 初始化 MFC 并在失败时显示错误
+	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
+	{
+		// TODO: 更改错误代码以符合您的需要
+		_tprintf(_T("错误: MFC 初始化失败\n"));
+		nRetCode = 1;
+	}
+	else
+	{
+		// TODO: 在此处为应用程序的行为编写代码。
+		//std::string host = "http://10.118.158.52:8580";//"http://10.118.158.198:8090";
+		std::string host = "http://10.118.158.198:8090";
+		SATParameters::STDevice stDevice;
+		stDevice.strStatus = "0";
+		stDevice.strDeviceSerial = "192.168.1.119:5555";
+		stDevice.strHardwareVersion = "MS6488";
+		stDevice.strManu = "MStar";
+		stDevice.strDeviceMac = "";
+		stDevice.strLastJobStartTime = "";
+		stDevice.strLastTimeBreak = "";
+		stDevice.strComments = "";
+		stDevice.strCPU = "";
+		stDevice.strSoftwareVersion = "1522659174";
+		stDevice.strPhoneNumber = "";
+		stDevice.strLastJobFinishTime = "";
+		stDevice.strMemory = "";
+		stDevice.strModel = "Generic Linux on tcl_ms6488_cn_64_n";
+		stDevice.strLastJob = "";
+		stDevice.strLastTimeConnected = "2019-12-16 10:16:01";
+		stDevice.strElectric = "";
+		// ##########################先登录##############################;
+		SATParameters::STLoginReq stLoginReq;
+		SATParameters::STLoginResp stLoginResp;
+		std::string url = host + "/btc_execute_se/ajaxInteractiveManage!executeLogin.action";
+		// 示例值;
+		stLoginReq.strUserName = "superAdmin";
+		stLoginReq.strStatus = "0";
+		stLoginReq.strDeleteStatus = "";
+		stLoginReq.strIP = "10.118.158.175";
+		stLoginReq.strStorage = "";
+		stLoginReq.strConnectTime = "";
+		stLoginReq.strExecuteName = "";
+		stLoginReq.strMAC = "40:16:7e:23:10:53";
+		stLoginReq.strDisconnectTime = "";
+		stLoginReq.strPassword = "123456";
+		stLoginReq.strCPU = "";
+
+		if ( !Login(url, stLoginReq, stLoginResp) )
+		{
+			system("pause");
+			return -1;
+		}
+
+		printf("登录返回:code=%s, msg=%s, str=%s, portCount=%d, companyid=%d, runnertoken=%s\n",
+			stLoginResp.strCode.c_str(),
+			stLoginResp.strMessage.c_str(),
+			stLoginResp.strStr.c_str(),
+			stLoginResp.nPortCount,
+			stLoginResp.nCompanyId,
+			stLoginResp.strRunnerToken.c_str()
+			);		
+
+		while(true)
+		{
+			// ##########################更新设备信息##############################;
+			SATParameters::STUpdateDeviceReq stUpdateDeviceReq;
+			SATParameters::STUpdateDeviceResp stUpdateDeviceResp;
+			__if_not_exists(url)
+			{			
+				std::string url = host + "/btc_execute_se/ajaxInteractiveManage!updateDeviceMessage.action";
+			}
+			__if_exists(url)
+			{
+				url = host + "/btc_execute_se/ajaxInteractiveManage!updateDeviceMessage.action";
+			}
+
+			stUpdateDeviceReq.strStatus = "0";
+			stUpdateDeviceReq.strUserName = "superAdmin";		
+			stUpdateDeviceReq.strIP = "10.118.158.175";
+			stUpdateDeviceReq.strStorage = "228092536KB";
+			stUpdateDeviceReq.strRunnerName = "SAT-Admin";
+			stUpdateDeviceReq.strMAC = "40:16:7e:23:10:53";
+			stUpdateDeviceReq.strReportType = "1";
+			stUpdateDeviceReq.strStartTime = "2019-12-16 19:15:30";
+			stUpdateDeviceReq.strMemory = "8938544KB";
+			stUpdateDeviceReq.strEndTime = "";
+			stUpdateDeviceReq.strCPU = "24.7%";
+			stUpdateDeviceReq.devicelist.push_back(stDevice);
+
+			if ( UpdateDeviceMessage(url, stUpdateDeviceReq, stUpdateDeviceResp) )
+			{
+				printf("更新设备信息成功:code=%s, msg=%s, str=%s\n",
+					stLoginResp.strCode.c_str(),
+					stLoginResp.strMessage.c_str(),
+					stLoginResp.strStr.c_str());
+			}
+			else
+			{
+				printf("更新设备信息失败!\n");
+			}
+
+			// ##########################心跳包机制##############################;
+			SATParameters::STHeartbeatReq stHeartbeatReq;
+			SATParameters::STHeartbeatResp stHeartbeatResp;
+			__if_not_exists(url)
+			{			
+				std::string url = host + "/btc_execute_se/ajaxInteractiveManage!executeHeartbeat.action";
+			}
+			__if_exists(url)
+			{
+				url = host + "/btc_execute_se/ajaxInteractiveManage!executeHeartbeat.action";
+			}
+
+			// 示例值;
+			//stDevice.strStatus = "0";
+			//stDevice.strDeviceSerial = "192.168.1.119:5555";
+
+			stHeartbeatReq.strUserName = "superAdmin";
+			stHeartbeatReq.strRunnerMac = "40:16:7e:23:10:53";
+			stHeartbeatReq.devicelist.push_back(stDevice);
+			if ( Heartbeat(url, stHeartbeatReq, stHeartbeatResp) )
+			{
+				printf("登录返回:code=%s, msg=%s, str=%s\n",
+					stHeartbeatResp.strCode.c_str(),
+					stHeartbeatResp.strMessage.c_str(),
+					stHeartbeatResp.strStr.c_str());
+
+				// 判断是否有任务获取成功;
+				if ( stHeartbeatResp.vtTask.size() )
+				{
+					// #########################################################################################
+					// 通知SAT变更任务状态;
+					SATParameters::STTask stTask = stHeartbeatResp.vtTask[0];
+					SATParameters::STNotifyJobStartReq stNotifyJobStartReq;
+					SATParameters::STNotifyJobStartResp stNotifyJobStartResp;
+
+					__if_not_exists(url)
+					{			
+						std::string url = host + "/btc_execute_se/ajaxInteractiveManage!setResult.action";
+					}
+					__if_exists(url)
+					{
+						url = host + "/btc_execute_se/ajaxInteractiveManage!setResult.action";
+					}
+
+					TCHAR szValue[36] = {0};
+					_itoa_s(stTask.nDeviceId, szValue, 10);
+					stNotifyJobStartReq.strDeviceId = szValue;
+
+					_itoa_s(stTask.nExecuteId, szValue, 10);
+					stNotifyJobStartReq.strExecuteId = szValue;
+
+					// _itoa_s(stTask.nInstanceId, szValue, 10); // 误导:应该使用id而不是nInstanceId
+					_itoa_s(stTask.Id, szValue, 10);
+					stNotifyJobStartReq.strInstanceId = szValue;					
+
+					_itoa_s(stTask.nTaskId, szValue, 10);
+					stNotifyJobStartReq.strTaskId = szValue;
+
+					stNotifyJobStartReq.strSignalImageUrl = "D:\\\\SAT\\\\Runner\\\\btc_runner_se\\\\runner\\\\output\\\\";//ODF_NPI_RT2841\\\\20191216101613370\\\\192.168.1.119_5555";
+					stNotifyJobStartReq.strSignalImageUrl.append(stTask.strTaskName+"\\\\");
+					stNotifyJobStartReq.strSignalImageUrl.append(stTask.Job.strUniqueId+"\\\\");
+					stNotifyJobStartReq.strSignalImageUrl.append(stTask.Job.strDeviceId);
+					
+					for( int n = 0; n < 2; n++)
+					{						
+						// 查询任务是否已在SAT上存在;
+						if ( NotifyJobStart(url, stNotifyJobStartReq, stNotifyJobStartResp) )
+						{
+							// 更新设备为忙碌状态;
+							// 忙碌状态,此时请求Heartbeat将不会查询任务;
+							stDevice.strStatus = "2";
+							printf("NotifyJobStart 成功\n");
+						}
+						else
+						{
+							printf("NotifyJobStart 失败\n");
+						}
+					}
+
+					stDevice.strStatus = "0";
+					// #########################################################################################
+					// 开始Job;
+					SATParameters::STJobProcessReq stJobProcessReq;
+					SATParameters::STJobProcessResp stJobProcessResp;
+					__if_not_exists(url)
+					{			
+						std::string url = host + "/btc_execute_se/ajaxInteractiveManage!setResultList.action";
+					}
+					__if_exists(url)
+					{
+						url = host + "/btc_execute_se/ajaxInteractiveManage!setResultList.action";
+					}
+
+					{
+						stJobProcessReq.strResultState = "1";
+						stJobProcessReq.strCaseScene = "";
+						stJobProcessReq.strCaseStep = "0";
+						stJobProcessReq.strApkMD5 = "";
+						stJobProcessReq.strCrashTime = "";
+						// 就是Task中的ExecuteId
+						_itoa_s(stTask.nExecuteId, szValue, 10);
+						stJobProcessReq.strRunnerId = szValue;
+						stJobProcessReq.strCPUInfo = "0";
+						stJobProcessReq.strRunnedActionNameList = "";
+						stJobProcessReq.strArtificialResult = "";
+						stJobProcessReq.strArtificialModify = "";
+						stJobProcessReq.strRunnerName = "";
+						stJobProcessReq.strTaskType = "FUNCTIONALITY";
+						stJobProcessReq.strCaseRepeat = "";
+						stJobProcessReq.strApplicationGroup = "";
+						// 实例Id;
+						_itoa_s(stTask.nInstanceId, szValue, 10);
+						stJobProcessReq.strInstanceId = szValue;
+						stJobProcessReq.strCaseId = "";
+						stJobProcessReq.strProgress = "0";
+						stJobProcessReq.strReusltMessage = "任务开始";
+						stJobProcessReq.strJobRepeat = "";
+						stJobProcessReq.strScreenShot = "";
+						stJobProcessReq.strStartTime = "2019-12-16 10:16:43";
+						stJobProcessReq.strCrashNumber = "";
+						stJobProcessReq.strCaseName = "";
+						stJobProcessReq.strFailedReason = "";
+						stJobProcessReq.strImgName = "";
+						stJobProcessReq.strCaseIndex = "";
+						// 实例Id;
+						_itoa_s(stTask.nDeviceId, szValue, 10);
+						stJobProcessReq.strDeviceId = szValue;
+						stJobProcessReq.strSceneIndex = "";
+						// 实例Id;
+						_itoa_s(stTask.nTaskId, szValue, 10);
+						stJobProcessReq.strTaskId = szValue;
+						stJobProcessReq.strAnalysis = "";
+						// 设备名称:即DeviceSerial;
+						stJobProcessReq.strDevnceName = stDevice.strDeviceSerial;
+						// 固定为:TOTAL
+						stJobProcessReq.strInfoType = "TOTAL";
+						// 如果是Android设备,需要通过adb获取;
+						stJobProcessReq.strMemoryInfo = stDevice.strMemory;
+						stJobProcessReq.strEndTime = "2019-12-16 10:18:20";
+						stJobProcessReq.strRoundNumber = "1";
+						stJobProcessReq.strResultType = "0";
+						stJobProcessReq.strOperationStep = "";
+					}
+
+					// 
+					if ( ProcessJob(url, stJobProcessReq, stJobProcessResp) )
+					{
+						// 开始下载脚本;
+						__if_not_exists(url)
+						{			
+							std::string url = host + "/btc_caseManagement_se/ajaxInteractiveManage!getCaseFileListUrl.action";
+						}
+						__if_exists(url)
+						{
+							url = host + "/btc_caseManagement_se/ajaxInteractiveManage!getCaseFileListUrl.action";
+						}
+
+						SATParameters::STScriptUrlResp stScriptUrlResp;
+						std::vector<SATParameters::STCase>::iterator it = stTask.Job.vtCases.begin();
+						for ( ; it != stTask.Job.vtCases.end(); it++ )
+						{
+							if ( DownloadScript(url, it->strId, "D:\\SAT\\", stScriptUrlResp) )
+							{
+								printf("获取脚本下载地址成功:%s\n路径:%s\n", stScriptUrlResp.strURL.c_str(), stScriptUrlResp.strScripFile.c_str());
+							}
+							else
+							{
+								printf("获取脚本下载地址失败\n");
+							}
+						}						
+					}
+				}
+			}
+
+			Sleep(3000);
+		}
+
+	}
+
+	system("pause");
+
+	return nRetCode;
+}

+ 3 - 0
SATService/SATService/SATService.h

@@ -0,0 +1,3 @@
+#pragma once
+
+#include "resource.h"

+ 69 - 0
SATService/SATService/SATService.rc

@@ -0,0 +1,69 @@
+//Microsoft Visual C++ 生成的资源脚本。
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// 从 TEXTINCLUDE 2 资源生成。
+//
+#include "afxres.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
+LANGUAGE 4, 2
+#pragma code_page(936)
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// 字符串表
+//
+
+STRINGTABLE
+BEGIN
+   IDS_APP_TITLE       "SATService"
+END
+
+#endif
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// 从 TEXTINCLUDE 3 资源生成。
+//
+#ifndef _AFXDLL
+#include "l.CHS\\afxres.rc"
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // 不是 APSTUDIO_INVOKED

+ 248 - 0
SATService/SATService/SATService.vcproj

@@ -0,0 +1,248 @@
+<?xml version="1.0" encoding="gb2312"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="SATService"
+	ProjectGUID="{47EA9E19-826D-436E-9E97-5E1824F8E6EC}"
+	RootNamespace="SATService"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\..\bin\$(SolutionName)"
+			IntermediateDirectory="$(OutDir)\$(ProjectName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="2"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="SATHTTP.lib RunPython.lib"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\..\bin\$(SolutionName)"
+			IntermediateDirectory="$(OutDir)\$(ProjectName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="2"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Ô´Îļþ"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\SATService.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\stdafx.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Í·Îļþ"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\Resource.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RunPython.h"
+				>
+			</File>
+			<File
+				RelativePath=".\SATHTTP.h"
+				>
+			</File>
+			<File
+				RelativePath=".\SATService.h"
+				>
+			</File>
+			<File
+				RelativePath=".\stdafx.h"
+				>
+			</File>
+			<File
+				RelativePath=".\targetver.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="×ÊÔ´Îļþ"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+			<File
+				RelativePath=".\SATService.rc"
+				>
+			</File>
+		</Filter>
+		<File
+			RelativePath=".\ReadMe.txt"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

+ 8 - 0
SATService/SATService/stdafx.cpp

@@ -0,0 +1,8 @@
+// stdafx.cpp : 只包括标准包含文件的源文件
+// SATService.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+// TODO: 在 STDAFX.H 中
+// 引用任何所需的附加头文件,而不是在此文件中引用

+ 35 - 0
SATService/SATService/stdafx.h

@@ -0,0 +1,35 @@
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#include <stdio.h>
+#include <tchar.h>
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // 某些 CString 构造函数将是显式的
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN            // 从 Windows 头中排除极少使用的资料
+#endif
+
+#include <afx.h>
+#include <afxwin.h>         // MFC 核心组件和标准组件
+#include <afxext.h>         // MFC 扩展
+#ifndef _AFX_NO_OLE_SUPPORT
+#include <afxdtctl.h>           // MFC 对 Internet Explorer 4 公共控件的支持
+#endif
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>                     // MFC 对 Windows 公共控件的支持
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include "SATHTTP.h"
+#include "RunPython.h"
+
+
+// TODO: 在此处引用程序需要的其他头文件

+ 24 - 0
SATService/SATService/targetver.h

@@ -0,0 +1,24 @@
+#pragma once
+
+// 以下宏定义要求的最低平台。要求的最低平台
+// 是具有运行应用程序所需功能的 Windows、Internet Explorer 等产品的
+// 最早版本。通过在指定版本及更低版本的平台上启用所有可用的功能,宏可以
+// 正常工作。
+
+// 如果必须要针对低于以下指定版本的平台,请修改下列定义。
+// 有关不同平台对应值的最新信息,请参考 MSDN。
+#ifndef WINVER                          // 指定要求的最低平台是 Windows Vista。
+#define WINVER 0x0600           // 将此值更改为相应的值,以适用于 Windows 的其他版本。
+#endif
+
+#ifndef _WIN32_WINNT            // 指定要求的最低平台是 Windows Vista。
+#define _WIN32_WINNT 0x0600     // 将此值更改为相应的值,以适用于 Windows 的其他版本。
+#endif
+
+#ifndef _WIN32_WINDOWS          // 指定要求的最低平台是 Windows 98。
+#define _WIN32_WINDOWS 0x0410 // 将此值更改为适当的值,以适用于 Windows Me 或更高版本。
+#endif
+
+#ifndef _WIN32_IE                       // 指定要求的最低平台是 Internet Explorer 7.0。
+#define _WIN32_IE 0x0700        // 将此值更改为相应的值,以适用于 IE 的其他版本。
+#endif