亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? crobotinternet.cpp

?? beereader source code
?? CPP
?? 第 1 頁 / 共 4 頁
字號(hào):

	AfxParseURL(sTempURL, dwService, sServer, sObject, nPort);

	sPath = sObject;

	if (sPath=="")
		sPath = "/";

	if (sPath.Find(".") != -1) 
	{
		nPos = sPath.ReverseFind('/');
		if (nPos != -1)
			sPath = sPath.Left(nPos + 1);
	} // End if

	if (sPath.Right(1) != "/")
		sPath += "/";

	return sPath;
}


// --------------------------------------------------------------
// ******************* public
// *                 *
// *  RobotExcluded  *
// *                 *
// *******************
// Function: Scans a robot policy file (previous acquired from a site),
//			 and reports  whether  a  particular  URL  is  considered
//			 accessible. This function expects the  m_sUserAgent field
//			 to have been set in advance to identify the agent.
//
// Inputs:	sRobotPolicy      - A site's robots.txt file (httpGet may
//								 be used to acquire this file)
//			sUrlToAccess	  - A fully qualified URL
//
// Outputs:	<function_result> - True if access is excluded (denied);
//								 false if access is not explicitly 
//								 prohibited

BOOL CRobotInternet::RobotExcluded(const CString& sRobotPolicy,
								   const CString& sUrlToAccess)
{
	CString sPath = ParsePathFromURL(sUrlToAccess);
	BOOL bIsExcluded;

	/* Unless the user agent value is blank, first check for an
	   explicit reference to this agent */
	
	if (m_sUserAgent != "")
		if (CheckExclusion(sRobotPolicy,
						   m_sUserAgent,
						   sPath,
						   bIsExcluded))
			/* There is an entry for the user agent */
			return bIsExcluded;
	
	/* If there is no entry for the user agent, look for an entry
	   that applies to * (all other robots) */

	if (CheckExclusion(sRobotPolicy, "*", sPath, bIsExcluded))
		/* there is an entry for "*" */
		return bIsExcluded;

	/* Robots.txt contains neither specific nor default prohibitions.
	   Return false to indicate no exclusion. */

	return false;
}

// --------------------------------------------------------------
// ******************** private
// *                  *
// *  CheckExclusion  *
// *                  *
// ********************
// This is a private function called by the public 
//  function RobotExcluded
//
// Function: Scans a URL and returns the server portion of the URL
//
// Inputs:	sRobotPolicy      - Text of robots.txt file previously
//								 acquired from a site.
//			sAgent            - User agent entry to search for. Can 
//								 be a specific agent name, or "*".
//			sPath	          - The path name to be visited on
//								 the site.
//
// Outputs:	<function_result> - True if a section of robots.txt was
//								 found for sAgent
//			bIsExcluded       - Set to true if the access is
//								 explicitly denied; set to true
//								 otherwise

BOOL CRobotInternet::CheckExclusion(const CString& sRobotPolicy,
									const CString& sAgent,
									const CString& sPath,
									BOOL& bIsExcluded)
{
	int nPos;
	int nAgentLen, nExclusionLen;

	CString sRobotLower = sRobotPolicy;
	sRobotLower.MakeLower();

	CString sAgentLower = sAgent;
	sAgentLower.MakeLower();

	nAgentLen = sAgentLower.GetLength();

	CString sPathLower = sPath;
	sPathLower.MakeLower();

	CString sEntryLower = "";

	CString sExclusion = "";

	BOOL bScanningUserAgent, bScanningDisallow;

	/* Find each user-agent: entry and compare it to the
	   agent name specified */

	bScanningUserAgent = true;
	while (bScanningUserAgent) 
	{
		nPos = sRobotLower.Find("user-agent:");
		if (nPos != -1) 
		{
			sRobotLower = sRobotLower.Mid(nPos + 11);
			sRobotLower.TrimLeft();
			if (sRobotLower.Left(nAgentLen) == sAgentLower) 
			{
				// Found entry for this agent
				nPos = sRobotLower.Find("user-agent:");
				if (nPos == -1)
					sEntryLower = sRobotLower;
				else
					sEntryLower = sRobotLower.Left(nPos);
				
				// Find each disallow: statement in the entry

				bScanningDisallow = true;
				while (bScanningDisallow) 
				{
					nPos = sEntryLower.Find("disallow:");
					if (nPos != -1) 
					{
						sEntryLower = sEntryLower.Mid(nPos + 9);
						sEntryLower.TrimLeft();
						nPos = sEntryLower.Find("disallow:");
						if (nPos == -1)
							sExclusion = sEntryLower;
						else
							sExclusion = sEntryLower.Left(nPos);
						sExclusion.TrimRight();
						if (sExclusion.Right(1) != "/")
							sExclusion += "/";
						nExclusionLen = sExclusion.GetLength();

						/* Compare exclusion to target path to see 
						   if there is a match */
						if (sPath.Left(nExclusionLen) == sExclusion)
						{
							bIsExcluded = true;
							return true;
						} // End if sPath
						
					} // End if nPos
					else
						bScanningDisallow = false;
				} // End while bScanningDisallow

				/* No exclusion encountered or function would have 
				   already returned */
				bIsExcluded = false;
				
				// There is an entry for this agent
				return true;
			} // End if
		} // end if nPos
		else
			bScanningUserAgent = false;
	} // End while bScanningUserAgent

	bIsExcluded = false;
	return false;	/* Agent entry not found */
}


// **************************************************************
// *															*
// *															*
// *					F T P  F u n c t i o n s				*
// *															*
// *															*
// **************************************************************


// --------------------------------------------------------------
// ****************
// *              *
// *  ftpGetFile  *
// *              *
// ****************
// Function: Retrieves a file from an FTP site
//
// Inputs:	sURL              - URL to access, incouding user id
//								 and password info if required
//			sDir              - Directory to move to (optional;
//								 leave blank or NULL to access
//								 default directory).
//			sRemoteFilespec	  - Name of file on remote FTP server
//								 to be retrieved.
//			sLocalFilespec	  - Name to give retrieved file on
//								 local system.
//
// Outputs:	<function-result> - True if successful, false if an
//								 error occurred
//			nResult           - Error code (0 = no error,
//								 n = error code)
//			sErrMsg           - Error message text of error (if any)

BOOL CRobotInternet::ftpGetFile(const CString& sUrl,
								const CString& sDir,
								const CString& sRemoteFilespec,
								const CString& sLocalFilespec,
								int& nResult, CString& sErrMsg)
{
	TCHAR sz[1024];
	CInternetSession* pSession = NULL;
	CStdioFile* pFile = NULL;
	DWORD nRead = 0;
	CFile* pMyFile = NULL;
	CString sId, sPassword;
	CString sTemp;
	CString sWorkingUrl, sWorkingDir;
	nResult = CROBOT_ERR_SUCCESS;
	CString sMsg;
	CString sHeader = "Accept: */*\r\n\r\n";

	try 
	{
		pSession = new CInternetSession(m_sUserAgent,
										1,
										INTERNET_OPEN_TYPE_PRECONFIG);

		sWorkingUrl = sUrl;
		sWorkingUrl.TrimLeft();
		sWorkingUrl.TrimRight();

		// Check for invalid parameters
		if (!(sUrl.IsEmpty()) 
			&& !(sLocalFilespec.IsEmpty()) 
			&& !(sRemoteFilespec.IsEmpty())) 
		{
			sId = m_sLogonUsername;
			sPassword = m_sLogonPassword;
			
			sTemp = sWorkingUrl.Left(4);
			sTemp.MakeLower();;
			if (sTemp == "ftp:") sWorkingUrl = sWorkingUrl.Mid(4);

			if (sWorkingUrl.Left(2) == "//")
				sWorkingUrl = sWorkingUrl.Mid(2);

			int nPos1 = sWorkingUrl.Find(":");
			int nPos2 = sWorkingUrl.Find("@");
			if (nPos1 > 0 && nPos2 > nPos1) 
			{
				sId = sWorkingUrl.Left(nPos1);
				sPassword = sWorkingUrl.Mid(nPos1 + 1,
											nPos2 - nPos1 - 1);
				sWorkingUrl = sWorkingUrl.Mid(nPos2 + 1);
			} // End if

			if (sId == "")
				sWorkingUrl = "ftp://" + sWorkingUrl;
			else
				sWorkingUrl = "ftp://"
							  + sId
							  + ":"
							  + sPassword
							  + "@"
							  + sWorkingUrl;

			if (sWorkingUrl.Right(1) != "/") sWorkingUrl += "/";

			sWorkingDir = sDir;
			if (sWorkingDir != "") 
			{
				if (sWorkingDir.Left(1) == "/")
					sWorkingDir = sWorkingDir.Mid(1);
				sWorkingUrl += sWorkingDir;
				if (sWorkingUrl.Right(1) != "/") sWorkingUrl += "/";
			} // End if

			sWorkingUrl += sRemoteFilespec;

			pMyFile = new CFile;
			if (pMyFile->Open(sLocalFilespec,
							  CFile::modeCreate
							      | CFile::modeReadWrite)) 
			{
				pFile = pSession->OpenURL (
									sWorkingUrl,
									1,
									INTERNET_FLAG_RELOAD
									    | INTERNET_FLAG_TRANSFER_BINARY,
									sHeader, // szHead
									-1L);
				if (pFile) /* OpenURL worked */
				{
					nResult = CROBOT_ERR_SUCCESS;
					// Get data
					do 
					{
					   nRead = pFile->Read(sz, 1023);
					   if (nRead != 0) 
					   {
							sz[nRead] = 0;
							pMyFile->Write (sz, nRead);
					   } // End if
					} while (nRead != 0);	// End do ... while
					nResult = CROBOT_ERR_SUCCESS;
				} // End if pFile
				else /* OpenURL failed */
				{
					nResult = CROBOT_ERR_CONNECTION_FAILED;
				} // End else
			} // End if
			else 
			{
				nResult = CROBOT_ERR_DISK_FILE_ERROR;
			} // End else
		} // End if
		else
			nResult = CROBOT_ERR_INVALID_PARAMETER;
	} // End try

	catch (CInternetException *pEx) 
	{
		switch(pEx->m_dwError) 
		{
		case ERROR_INTERNET_TIMEOUT:
			nResult = CROBOT_ERR_TIMED_OUT;
			break;
		case ERROR_INTERNET_INVALID_URL:
			nResult = CROBOT_ERR_INVALID_URL;
			break;
		case ERROR_INTERNET_EXTENDED_ERROR:
			// Invalid or non-existing filename
			nResult = CROBOT_ERR_NOT_FOUND;
			break;
		case ERROR_INTERNET_INCORRECT_USER_NAME:
		case ERROR_INTERNET_INCORRECT_PASSWORD:
		case ERROR_INTERNET_LOGIN_FAILURE:
			nResult = CROBOT_ERR_NOT_AUTHORIZED;
			break;
		default:
			nResult = CROBOT_ERR_CONNECTION_FAILED;
			break;
		} // End switch
		pEx->Delete();
	} // End catch

	catch (CFileException *pEx) 
	{
		int nErr = pEx->m_cause;
		pEx->Delete();
		nResult = CROBOT_ERR_FILE+nErr;
	} // End catch

	catch (...) 
	{
		nResult = CROBOT_ERR_CONNECTION_FAILED;
	} // End catch

// Clean up and exit function

	if (pFile != NULL) 
	{
		pFile->Close();
		delete pFile; 
	} // End if
	
	if (pMyFile != NULL) 
	{ 
		pMyFile->Close();
		delete pMyFile; 
	} // End if
	
	if (pSession != NULL) 
	{
		pSession->Close();
		delete pSession; 
	} // End if
	
	sErrMsg = ErrorMessage(nResult);
	if (nResult == CROBOT_ERR_SUCCESS)
		return true;
	else
		return false;
}

// --------------------------------------------------------------
// ****************
// *              *
// *  PutFtpFile  *
// *              *
// ****************
//
// Outputs:	<functionresult> - 0 for success, or error code

BOOL CRobotInternet::ftpPutFile(const CString& sUrl,
								const CString& sDir,
								const CString& sLocalFilespec,
								const CString& sRemoteFilespec,
								int& nResult, CString& sErrMsg)
{
	#define	FTP_UNKNOWN	 0
	#define	FTP_BLANK	 1
	#define	FTP_OPEN	 2
	#define	FTP_CLOSE	 3
	#define	FTP_CD		 4
	#define	FTP_LCD		 5
	#define	FTP_GET		 6
	#define	FTP_PUT		 7
	#define	FTP_BYE		 8
	#define	FTP_ASCII	 9
	#define	FTP_BINARY	10

	CInternetSession* pSession = NULL;
	CFtpConnection* pFTPConnection = NULL;
	CString LocalFile, RemoteFile;
	CString sWorkingUrl;
	CString sId, sPassword;
	CString sTemp;
	nResult = CROBOT_ERR_SUCCESS;
	CString sMsg;

	try 
	{
		sWorkingUrl = sUrl;
		sWorkingUrl.TrimLeft();
		sWorkingUrl.TrimRight();

		// Check for invalid parameters

		if (!(sWorkingUrl.IsEmpty())
			&& !(sLocalFilespec.IsEmpty())
			&& !(sRemoteFilespec.IsEmpty())) 
		{

			// See if the file to send exists and is available
			
			CFileStatus fs;

			if (CFile::GetStatus(sLocalFilespec, fs)) 
			{

				/* If user:password@ specified in URL, extract to 
				   sID and sPassword and shorten sWorkingUrl */

				sId = m_sLogonUsername;
				sPassword = m_sLogonPassword;
				
				sTemp = sWorkingUrl.Left(4);
				sTemp.MakeLower();
				if (sTemp == "ftp:")
					sWorkingUrl = sWorkingUrl.Mid(4);

				if (sWorkingUrl.Left(2) == "//")
					sWorkingUrl = sWorkingUrl.Mid(2);

				int nPos1 = sWorkingUrl.Find(":");
				int nPos2 = sWorkingUrl.Find("@");
				if (nPos1 > 0 && nPos2 > nPos1) 
				{
					sId = sWorkingUrl.Left(nPos1);
					sPassword = sWorkingUrl.Mid(nPos1 + 1,
												nPos2 - nPos1 - 1);
					sWorkingUrl = sWorkingUrl.Mid(nPos2 + 1);
				} // End if
				
				// Establish Internet connection

				pSession = new CInternetSession(
										m_sUserAgent,
										1,
										INTERNET_OPEN_TYPE_PRECONFIG);

				if (pSession) 
				{
					
					// Session established. Now open connection.

					pFTPConnection = pSession->GetFtpConnection(
														sWorkingUrl,
														sId,
														sPassword);
					
					if (pFTPConnection) 
					{
						
						/* Established FTP connection.
						   Set the directory (unless blank sDir
						   passed to function). */

						if (sDir != "" 
							&& !pFTPConnection->SetCurrentDirectory(sDir))
							// Set directory failed
							nResult = CROBOT_ERR_CONNECTION_FAILED;
						else 
						{
							// Send the file
							if (!pFTPConnection->PutFile(
											sLocalFilespec,
											sRemoteFilespec,
											FTP_TRANSFER_TYPE_BINARY,
											1))
								// File transfer failed
								nResult = CROBOT_ERR_CONNECTION_FAILED;
							else
								nResult = CROBOT_ERR_SUCCESS;
						} // End else

					} // End if
					else
						// FTP connection failed
						nResult = CROBOT_ERR_CONNECTION_FAILED;
				} // End if
				else
					// Unable to create session
					nResult = CROBOT_ERR_CONNECTION_FAILED;
			} // End if
			else
				// File to send does not exist
				nResult = CROBOT_ERR_NOT_FOUND;
		} // End if
		else
			// Empty parameter
			nResult = CROBOT_ERR_INVALID_PARAMETER;
	} // End try

	catch(CInternetException* pEx) 
	{
		switch(pEx->m_dwError) 
		{
		case ERROR_INTERNET_TIMEOUT:
			nResult = CROBOT_ERR_TIMED_OUT;
			break;
		case ERROR_INTERNET_INVALID_URL:
			nResult = CROBOT_ERR_INVALID_URL;
			break;
		case ERROR_INTERNET_EXTENDED_ERROR:
			// Invalid or non-existing filename
			nResult = CROBOT_ERR_NOT_FOUND;
			break;
		case ERROR_INTERNET_INCORRECT_USER_NAME:
		case ERROR_INTERNET_INCORRECT_PASSWORD:
		case ERROR_INTERNET_LOGIN_FAILURE:
			nResult = CROBOT_ERR_NOT_AUTHORIZED;
			break;
		default:
			nResult = CROBOT_ERR_CONNECTION_FAILED;
			break;
		} // End switch
		pEx->Delete();
	} // End catch

	catch(...) 
	{
		nResult = CROBOT_ERR_CONNECTION_FAILED;
	} // End catch

// Clean up and exit function

	if (pFTPConnection != NULL) 
	{
		pFTPConnection->Close();
		delete pFTPConnection; 
	} // End if
	
	if (pSession != NULL) 
	{
		pSession->Close();
		delete pSession;
	} // End if

	sErrMsg = ErrorMessage(nResult);
	if (nResult == CROBOT_ERR_SUCCESS)
		return true;
	else
		return false;
};

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av亚洲精华国产精华精| 国产亚洲欧洲997久久综合 | av亚洲精华国产精华| 欧美精品在线观看一区二区| 中文字幕乱码一区二区免费| 视频一区欧美日韩| 粉嫩一区二区三区在线看| 欧美区在线观看| 亚洲乱码中文字幕| 国产高清久久久久| 欧美电视剧免费全集观看| 亚洲精品中文字幕在线观看| 国产精品一区二区无线| 欧美精品99久久久**| 国产一区中文字幕| 国产91富婆露脸刺激对白| 91精品国产色综合久久不卡蜜臀 | 洋洋成人永久网站入口| 成人一道本在线| 日韩精品中午字幕| 首页国产欧美日韩丝袜| 欧美自拍偷拍一区| 亚洲欧美一区二区三区久本道91| 成人免费av网站| 久久精品一区二区三区不卡牛牛 | 一区二区激情视频| youjizz久久| 国产精品日日摸夜夜摸av| 国产成人午夜99999| 26uuu亚洲| 黑人巨大精品欧美一区| 欧美一区二区国产| 日本特黄久久久高潮| 欧美另类一区二区三区| 亚洲电影一区二区三区| 欧美在线免费观看亚洲| 亚洲影视在线播放| 欧美日韩视频不卡| 丝袜亚洲另类丝袜在线| 日韩欧美国产高清| 激情综合网最新| 国产丝袜欧美中文另类| 成人免费毛片嘿嘿连载视频| 一区精品在线播放| 在线中文字幕一区二区| 视频一区二区欧美| 日韩一区二区免费在线观看| 精品在线免费观看| 欧美激情一二三区| 日本韩国欧美三级| 日本aⅴ免费视频一区二区三区| 欧美一区二区三区视频在线| 精品无人区卡一卡二卡三乱码免费卡 | 亚洲欧洲国产日韩| 色综合久久中文综合久久牛| 亚洲国产aⅴ天堂久久| 日韩精品专区在线影院重磅| 国产成人免费视频一区| 亚洲久本草在线中文字幕| 欧美日韩高清在线播放| 国产真实乱对白精彩久久| 日韩毛片一二三区| 欧美一区二区视频在线观看2022| 精品系列免费在线观看| 亚洲男女一区二区三区| 6080国产精品一区二区| 国产99久久久精品| 亚洲18色成人| 中文字幕不卡三区| 91麻豆精品国产91久久久更新时间| 国产精品一区二区男女羞羞无遮挡| 亚洲色图另类专区| 欧美videos大乳护士334| 97精品电影院| 黑人巨大精品欧美黑白配亚洲| 成人免费小视频| 日韩欧美中文字幕制服| 99视频一区二区三区| 久久国产综合精品| 亚洲一区二区三区四区在线免费观看 | 精品视频一区 二区 三区| 国产美女娇喘av呻吟久久| 一区二区三区在线视频播放| 亚洲精品在线观看视频| 欧美乱熟臀69xxxxxx| 91日韩在线专区| 国产精品18久久久久久久网站| 午夜精品一区二区三区电影天堂| 国产色产综合产在线视频| 欧美精品乱码久久久久久| 成人动漫在线一区| 久久99精品久久久久久动态图 | 石原莉奈在线亚洲三区| 国产精品成人免费精品自在线观看| 欧美不卡激情三级在线观看| 欧美影院午夜播放| 色综合久久综合| 99亚偷拍自图区亚洲| 国产一区二区三区蝌蚪| 久久国产精品第一页| 天堂蜜桃91精品| 亚洲国产日韩综合久久精品| 亚洲精品视频一区二区| 中文字幕一区视频| 国产精品丝袜一区| 国产女主播在线一区二区| 欧美不卡激情三级在线观看| 日韩欧美激情在线| 日韩欧美国产一区二区三区 | 精品一区二区三区视频在线观看| 亚洲成a人v欧美综合天堂下载| 一区二区视频在线| 亚洲精品写真福利| 亚洲激情综合网| 一区2区3区在线看| 亚洲一区二区在线免费看| 亚洲综合丝袜美腿| 亚洲国产精品欧美一二99| 亚洲国产精品久久一线不卡| 性感美女极品91精品| 日韩成人一级片| 精品一二三四区| 国产在线播放一区三区四| 国产乱人伦偷精品视频不卡| 国产成人精品亚洲777人妖| 成人免费视频免费观看| 91日韩精品一区| 欧美日韩国产另类一区| 欧美一区午夜视频在线观看| 日韩免费看网站| 久久久久9999亚洲精品| 国产精品高潮久久久久无| 亚洲日本中文字幕区| 天使萌一区二区三区免费观看| 久久99精品国产麻豆婷婷| 国产老肥熟一区二区三区| av一区二区三区四区| 欧美日韩国产一级| 精品国产免费人成电影在线观看四季 | 成人少妇影院yyyy| 欧美自拍丝袜亚洲| 日韩欧美中文一区二区| 国产婷婷一区二区| 亚洲综合在线视频| 精品伊人久久久久7777人| 成人在线视频首页| 欧美日韩免费在线视频| 国产午夜精品美女毛片视频| 亚洲精品视频在线看| 久久成人18免费观看| 97超碰欧美中文字幕| 欧美日韩在线播放一区| 久久综合色天天久久综合图片| 自拍偷拍亚洲激情| 九一九一国产精品| 欧美视频自拍偷拍| 久久久久成人黄色影片| 午夜精品一区二区三区三上悠亚| 国产在线国偷精品免费看| 在线视频国内自拍亚洲视频| 久久久亚洲欧洲日产国码αv| 亚洲综合另类小说| 国产99精品在线观看| 欧美疯狂性受xxxxx喷水图片| 亚洲国产岛国毛片在线| 久久国产日韩欧美精品| 欧美亚洲一区二区三区四区| 欧美韩国日本不卡| 奇米888四色在线精品| 欧美伊人久久大香线蕉综合69| 国产日韩欧美精品一区| 日韩精品乱码av一区二区| 色又黄又爽网站www久久| 久久婷婷国产综合国色天香| 天天色图综合网| 色婷婷精品大视频在线蜜桃视频| 精品国产乱码久久久久久影片| 亚洲综合色视频| 成人av网站在线| 精品国产第一区二区三区观看体验| 亚洲成人av电影| 欧美在线一二三四区| 国产精品国模大尺度视频| 国产成人在线免费观看| 日韩欧美不卡在线观看视频| 亚洲国产成人va在线观看天堂| 色哟哟亚洲精品| 亚洲欧美日韩人成在线播放| 国产91精品久久久久久久网曝门 | 亚洲精选一二三| 97久久精品人人做人人爽50路| 日本一二三不卡| 国产精品一卡二卡| 久久久午夜电影| 国产一区二区三区四| 日韩欧美一二区| 精品无人区卡一卡二卡三乱码免费卡| 91精品国产高清一区二区三区蜜臀| 亚洲一区在线观看免费 | 日韩一区和二区|