網遊BUG提交解決方案

來源:互聯網
上載者:User

1.網遊運行中的崩潰異常 etc 需要搜集上傳到電訊廠商的伺服器上,以便解決問題。

2.在此提供一個FTP上傳類。

3.當然上傳的檔案內容,不容我多說,是程式員自己定義的各種dump日誌。

#pragma once#include <string>#include <afxinet.h>using namespace std;class ZBugZiller{public:ZBugZiller();~ZBugZiller();void Release();void SetFTPInfo(const string & serverAddress, const int & portNumber = 21);void SetAccount (const string & strUserID, const string & strUserPassword);void ConnectFTP();void Upload(char * strlocalFile, char * strRemoteFile);private:stringm_userID;stringm_userPassword;stringm_strServerAddress;intm_iPortNo;private:// MFC classesCInternetSession *m_pSession;CFtpConnection *m_pFtpConnection;};

#include "StdAfx.h"#include ".\zbugziller.h"#include <IO.H>ZBugZiller::ZBugZiller(){m_userID = "";m_userPassword = "";m_strServerAddress = "";m_iPortNo = 21;m_pSession = NULL;m_pFtpConnection = NULL;}void ZBugZiller::SetFTPInfo(const string & serverAddress, const int & portNumber){m_strServerAddress = serverAddress;m_iPortNo = portNumber;}void ZBugZiller::SetAccount (const string & strUserID, const string & strUserPassword){m_userID = strUserID;m_userPassword = strUserPassword;}void ZBugZiller::ConnectFTP(){m_pSession = new CInternetSession();try{m_pFtpConnection = m_pSession->GetFtpConnection(m_strServerAddress.c_str(), m_userID.c_str(), m_userPassword.c_str(), m_iPortNo, TRUE);}catch ( ... ){Release();//MessageBox(HWND_DESKTOP, "[坷幅] : 輯滾俊 立加 且 薦 絕嚼聰促.", "宮氫柯扼牢", MB_OK);return;}}void ZBugZiller::Release(){if ( m_pFtpConnection != NULL ){m_pFtpConnection->Close();delete m_pFtpConnection;m_pFtpConnection =NULL;}if ( m_pSession != NULL ){m_pSession->Close();delete m_pSession;m_pSession =NULL;}}ZBugZiller::~ZBugZiller(void){Release();}void ZBugZiller::Upload(char * strlocalFile, char * strRemoteFile){if(!m_pFtpConnection || !m_pSession)return;//CFileStatus aStatus;//if ( CFile::GetStatus(strlocalFile, aStatus) == TRUE )//{/*CTime creationTime = aStatus.m_ctime;CString strTime = "[";        strTime += strKey.c_str();strTime += "]";strTime += creationTime.Format("(%Y-%m-%d)%H-%M-%S");*///CString strTime;if( _access(strlocalFile, 0) != -1){try{m_pFtpConnection->PutFile(strlocalFile, strRemoteFile, FTP_TRANSFER_TYPE_ASCII);}catch ( ... ){Release();//MessageBox(HWND_DESKTOP, "[坷幅] : 輯滾俊 肺弊甫 傈崔 且 薦 絕嚼聰促.", "宮氫柯扼牢", MB_OK);return;}while(1){if(DeleteFile(strlocalFile) == TRUE)break;Sleep(200);}}//}}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.