MFC通過Http請求上傳文件 MFC中發送HTTP或HTTPS請求

MFC通過Http請求上傳文件

void CMFCApplication1Dlg::HttpPostFile(string url, CString file, string paramName, string contentType)
{

CInternetSession pSession(_T("ic_PostWav")); //可以隨意
CHttpConnection* pConnect;
CHttpFile * pFile;

//通過 url解析出來
CString pServeIP = _T("127.0.0.1");
INTERNET_PORT wPort = 8888;
CString pObject = _T("/api/v1/documents/upload");

pConnect = pSession.GetHttpConnection(pServeIP, wPort);
pFile = pConnect->OpenRequest(CHttpConnection::HTTP_VERB_POST, pObject, NULL, 0, NULL, NULL, INTERNET_FLAG_DONT_CACHE);

string boundary = "----1a2b3c4d5e6f";
//Http 頭部
string pPostHeader;
pPostHeader = "Accept:audio/x-wav,text/html,application/xhtml+xml,application/xml,*/*;q=0.9,*/*;q=0.8\r\n";
pPostHeader += "Content-Type: multipart/form-data;";
pPostHeader += "boundary=" + boundary + "\r\n";
pPostHeader += "Connection: keep-alive\r\n";
CString httpHead;
httpHead.Format(_T("%s"), pPostHeader);
pFile->AddRequestHeaders(httpHead);

//數據幀頭
string dataTop, name,filename;
name = "name";
filename = "filename";

dataTop = "--"+ boundary +"\r\n";
dataTop += "Content-Disposition:form-data;";
dataTop += "name=\"" + name + "\";";
dataTop += "filename=\"" + filename + "\"\r\n";
dataTop += "Content-Type:" + contentType + "\r\n\r\n";

//byte* pPostTopbytes = new byte[dataTop.length()]; //todo
//for (int i = 0; i < dataTop.length();i++)
//{
// pPostTopbytes[i] = (byte)dataTop[i];
//}

byte* pPostTopbytes = (byte*)dataTop.c_str();

//數據包尾
string dataEnd;
dataEnd = "\r\n--" + boundary + "--\r\n";
//byte* enderbyte = new byte[ dataEnd.size()]; //todo
//for (int i = 0; i < dataEnd.length(); i++)
//{
// enderbyte[i] = (byte)dataEnd[i];
//}

byte* enderbyte = (byte*)dataEnd.c_str();


CFile cfile;
cfile.Open(file, CFile::modeRead | CFile::shareDenyRead, NULL);

DWORD dwSize = dataTop.length() + dataEnd.length() + cfile.GetLength();
pFile->SendRequestEx(dwSize);

//寫數據頭
pFile->Write(pPostTopbytes, dataTop.length());

//寫數據主體
int bufflength = 4 * 1024;
byte* buffer = new byte[bufflength];
int byteRead = 0;
while ((byteRead = cfile.Read(buffer, bufflength)) != 0)
{
pFile->Write(buffer, byteRead);
}
cfile.Close();

//寫數據尾部
pFile->Write(enderbyte, dataEnd.length() );
//發送文件
pFile->EndRequest();

//接收返回
CString strSentence = _T(""), strGetSentence = _T("");
DWORD dwRet;
pFile->QueryInfoStatusCode(dwRet);
if (HTTP_STATUS_OK == dwRet)
{
while (pFile->ReadString(strSentence)) // 讀取提交數據後的返回結果
{
strGetSentence = strGetSentence + strSentence;
}
char * temp = (char*)strGetSentence.GetBuffer(strGetSentence.GetLength());
string reponce(temp);
//todo: 將返回的編碼數據轉爲自己需要的編碼數據
}
pFile->Close();
pConnect->Close();
}

void CMFCApplication1Dlg::OnBnClickedOk()
{
//調用方式
HttpPostFile("", L"E:\\123\\內牆With柱fbx.pcx"/*L"E:\\123\\test.txt"*/, "uploadeFile", "application/octet-stream" /*L"text/plain"*/);
}


MFC中發送HTTP或HTTPS請求

 

基本知識

HTTP(超文本傳輸協議)
HTTPS(超文本傳輸安全協議)
URL(統一資源定位器)

例子

1. 一個簡單的例子

複製代碼
#include <afxinet.h>
#include <string>

bool testHttp(const CString& strUrl, const BYTE* data, int nBytes, CString& strReceive)
{
    // 解析Url
    // 例如:https://www.cnblogs.com/Zender/p/7596730.html
    DWORD dwServiceType;        // 協議類型:http/https    AFX_INET_SERVICE_HTTP (3)    AFX_INET_SERVICE_HTTPS (4107)
    CString strServer;            // Host    例如:www.cnblogs.com 或者 192.168.10.9
    CString strObject;            // other   例如:/Zender/p/7596730.html
    INTERNET_PORT wPort;        // 端口號   http的默認端口號是80,https的默認端口號是443
    if (!AfxParseURL(strUrl, dwServiceType, strServer, strObject, wPort))
    {
        //解析Url失敗
        return false;
    }
    CInternetSession session; // 創建會話
    const int nTimeOut = 10 * 1000;  // 超時設置爲 10s
    session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, nTimeOut);
    session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 2);
    CHttpConnection* pConn = NULL;
    CHttpFile* pFile = NULL;
    if (AFX_INET_SERVICE_HTTP == dwServiceType)
    {
        pConn = session.GetHttpConnection(strServer, wPort);
        pFile = pConn->OpenRequest(CHttpConnection::HTTP_VERB_POST, strObject);
    }
    else if (AFX_INET_SERVICE_HTTPS == dwServiceType)
    {
        pConn = session.GetHttpConnection(strServer, INTERNET_FLAG_SECURE, wPort);
        pFile = pConn->OpenRequest(CHttpConnection::HTTP_VERB_POST, strObject, NULL, 1, NULL, NULL,
            INTERNET_FLAG_SECURE | INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD |
            INTERNET_FLAG_IGNORE_CERT_CN_INVALID | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID);//SECURITY_FLAG_IGNORE_UNKNOWN_CA
    }
    else
    {
        //其他協議返回
        return false;
    }
    try
    {
        CString strHeaders("Content-Type: application/x-www-form-urlencoded");//請求頭
        BOOL bRet = pFile->SendRequest(strHeaders, (LPVOID)data, nBytes);
        if (!bRet)
        {
            goto Failure_label;
        }
        DWORD dwStatusCode;
        bRet = pFile->QueryInfoStatusCode(dwStatusCode);
        if (HTTP_STATUS_OK != dwStatusCode)//#define HTTP_STATUS_OK  200
        {
            CString strErrInfo;
            pFile->QueryInfo(HTTP_QUERY_RAW_HEADERS, strErrInfo);
            goto Failure_label;
        }
        std::string sReceive;
        char buffer[1024] = { 0 };
        for (UINT len = 0; (len = pFile->Read(buffer, sizeof(buffer))) > 0; memset(buffer, 0, sizeof(buffer)))
        {
            std::string s(buffer, len);
            sReceive += s;
        }
        strReceive = CStringA(sReceive.c_str(), sReceive.length());//注意:若sReceive中有\0,可能會截斷
        return true;
    }
    catch (CInternetException& e)
    {
        TCHAR szErr[512] = { 0 };
        e.GetErrorMessage(szErr, sizeof(szErr));
        CString strErrInfo;
        pFile->QueryInfo(HTTP_QUERY_RAW_HEADERS, strErrInfo);
        goto Failure_label;
    }

Failure_label:
    if (pConn)
    {
        pConn->Close();
        delete pConn;
        pConn = NULL;
    }
    if (pFile)
    {
        pFile->Close();
        delete pFile;
        pFile = NULL;
    }
    return false;
}
BOOL CtestMFCHttpApp::InitInstance()
{
    CString url("https://www.cnblogs.com/12Zender/p/7596730.html");
    CString strReceive;
    BYTE* data = (BYTE*)"123";
    testHttp(url,data,3,strReceive);
}
複製代碼

2. 網上別人封裝的類(MFC - HTTP(post與get)請求網頁內容或圖片

複製代碼
/////////////////  CHttpClient.h //////////////

#ifndef HTTPCLIENT_H
#define HTTPCLIENT_H
 
#include <afxinet.h>
 
#define  IE_AGENT  _T("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)")
#define  REQ_CODE_UTF8  _T("UTF-8")
#define  REQ_CODE_GBK   _T("GBK")
 
// 操作成功
#define SUCCESS        0
// 操作失敗
#define FAILURE        1
// 操作超時
#define OUTTIME        2
 
class CHttpClient
{
public:
    CHttpClient(const CString& szReqCode = REQ_CODE_UTF8,LPCTSTR strAgent = IE_AGENT);
    virtual ~CHttpClient(void);
 
    int HttpGet(LPCTSTR strUrl, CString &strResponse);
    int HttpGetImg(LPCTSTR strUrl, LPCTSTR imgPath);
    int HttpPost(LPCTSTR strUrl, CString &strResponse, LPCTSTR strPostData);
 
private:
    int ExecuteRequest(LPCTSTR strMethod, LPCTSTR strUrl, LPCTSTR strPostData, CString &strResponse, LPCTSTR imgPath);
    void Clear();
    CStringA GetReqData(const CString&  szReqData);
    CString  GetResData(const CStringA& szResData);
private:
    CInternetSession *m_pSession;
    CHttpConnection *m_pConnection;
    CHttpFile *m_pFile;
    CString m_szReqCode;
};
 
#endif



///////////////////// CHttpClient.cpp  ///////////////////
////////////////////////////////// HttpClient.cpp
#include "StdAfx.h"
#include "HttpClient.h"
 
#define  BUFFER_SIZE       1024
 
#define  NORMAL_CONNECT             INTERNET_FLAG_KEEP_CONNECTION
#define  SECURE_CONNECT             NORMAL_CONNECT | INTERNET_FLAG_SECURE
#define  NORMAL_REQUEST             INTERNET_FLAG_RELOAD | INTERNET_FLAG_DONT_CACHE
#define  SECURE_REQUEST             NORMAL_REQUEST | INTERNET_FLAG_SECURE | \
                                    INTERNET_FLAG_IGNORE_CERT_CN_INVALID| \
                                    INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 
 
CHttpClient::CHttpClient(const CString& szReqCode,LPCTSTR strAgent)
{
    m_pSession = new CInternetSession(strAgent);
    m_szReqCode = szReqCode;
    m_pConnection = NULL;
    m_pFile = NULL;
}
 
CHttpClient::~CHttpClient(void)
{
    Clear();
    if (NULL != m_pSession)
    {
        m_pSession->Close();
        delete m_pSession;
        m_pSession = NULL;
    }
}
 
void CHttpClient::Clear()
{
    if (NULL != m_pFile)
    {
        m_pFile->Close();
        delete m_pFile;
        m_pFile = NULL;
    }
 
    if (NULL != m_pConnection)
    {
        m_pConnection->Close();
        delete m_pConnection;
        m_pConnection = NULL;
    }
}
 
int CHttpClient::ExecuteRequest(LPCTSTR strMethod, LPCTSTR strUrl, LPCTSTR strPostData, CString &strResponse, LPCTSTR imgPath = NULL)
{
    DWORD dwFlags;
    CString strServer;
    CString strObject;
    DWORD dwServiceType;
    INTERNET_PORT nPort;
    strResponse = _T("");
 
 
    AfxParseURL(strUrl, dwServiceType, strServer, strObject, nPort);
 
    if (AFX_INET_SERVICE_HTTP != dwServiceType && AFX_INET_SERVICE_HTTPS != dwServiceType)
    {
        return FAILURE;
    }
    try
    {
        m_pConnection = m_pSession->GetHttpConnection(strServer,
            dwServiceType == AFX_INET_SERVICE_HTTP ? NORMAL_CONNECT : SECURE_CONNECT,nPort);
        m_pFile = m_pConnection->OpenRequest(strMethod, strObject, NULL, 1, NULL, NULL,
            (dwServiceType == AFX_INET_SERVICE_HTTP ? NORMAL_REQUEST : SECURE_REQUEST));
        if (AFX_INET_SERVICE_HTTPS == dwServiceType)
        {
            m_pFile->QueryOption(INTERNET_OPTION_SECURITY_FLAGS, dwFlags);
            dwFlags |= SECURITY_FLAG_IGNORE_UNKNOWN_CA;
            m_pFile->SetOption(INTERNET_OPTION_SECURITY_FLAGS, dwFlags);
        }
        m_pFile->AddRequestHeaders(_T("Accept: *,*/*"));
        m_pFile->AddRequestHeaders(_T("Accept-Language: zh-cn"));
        m_pFile->AddRequestHeaders(_T("Content-Type: application/x-www-form-urlencoded"));
        m_pFile->AddRequestHeaders(_T("Accept-Encoding: deflate"));
        if (strPostData != NULL) {
            CStringA strData = GetReqData(strPostData);
            m_pFile->SendRequest(NULL, 0, (LPVOID)(LPCSTR)strData, strlen(strData));
        }
        else {
            m_pFile->SendRequest();
        }
        
        char szChars[BUFFER_SIZE + 1] = { 0 };
        CStringA strRawResponse = "";
        UINT nReaded = 0;
 
        if (imgPath == NULL) {
            while ((nReaded = m_pFile->Read((void*)szChars, BUFFER_SIZE)) > 0)
            {
                szChars[nReaded] = '\0';
                strRawResponse += szChars;
                memset(szChars, 0, BUFFER_SIZE + 1);
            }
            strResponse = GetResData(strRawResponse);
        } else {
            CFile f;
            f.Open(imgPath, CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
            while ((nReaded = m_pFile->Read((void*)szChars, BUFFER_SIZE)) > 0)
            {
                szChars[nReaded] = '\0';
                f.Write(szChars, BUFFER_SIZE);
                memset(szChars, 0, BUFFER_SIZE + 1);
            }
            f.Close();
        }
        Clear();
    }
    catch (CInternetException* e)
    {
        Clear();
        DWORD dwErrorCode = e->m_dwError;
        e->Delete();
        DWORD dwError = GetLastError();
 
        if (ERROR_INTERNET_TIMEOUT == dwErrorCode)
        {
            return OUTTIME;
        }
        else
        {
            return FAILURE;
        }
    }
    return SUCCESS;
}
 
int CHttpClient::HttpGet(LPCTSTR strUrl, CString &strResponse)
{
    return ExecuteRequest(_T("GET"), strUrl, NULL, strResponse);
}
 
int CHttpClient::HttpPost(LPCTSTR strUrl, CString &strResponse, LPCTSTR strPostData)
{
    return ExecuteRequest(_T("POST"), strUrl, strPostData, strResponse);
}
 
int CHttpClient::HttpGetImg(LPCTSTR strUrl, LPCTSTR imgPath)
{
    CString str;
    return ExecuteRequest(_T("GET"), strUrl, NULL, str,imgPath);
}
CStringA CHttpClient::GetReqData(const CString& szReqData)
{
    // 預算-緩衝區中多字節的長度    
    int ansiiLen = WideCharToMultiByte(CP_UTF8, 0, szReqData, -1, NULL, 0, NULL, NULL);
    char * pAssii = (char*)malloc(sizeof(char)*ansiiLen);
    // 開始向緩衝區轉換字節    
    WideCharToMultiByte(CP_UTF8, 0, szReqData, -1, pAssii, ansiiLen, NULL, NULL);
    CStringA szRet(pAssii);
    free(pAssii);
    return szRet;
}
CString CHttpClient::GetResData(const CStringA& szResData)
{
    if (m_szReqCode == REQ_CODE_GBK)
        return CString(szResData);
    // 預算-緩衝區中寬字節的長度    
    int unicodeLen = MultiByteToWideChar(CP_UTF8, 0, szResData, -1, NULL, 0);
    wchar_t *pUnicode = (wchar_t*)malloc(sizeof(wchar_t)*unicodeLen);
    // 開始向緩衝區轉換字節    
    MultiByteToWideChar(CP_UTF8, 0, szResData, -1, pUnicode, unicodeLen);
    CString szRet(pUnicode);
    free(pUnicode);
    return szRet;
}




///////////////////// 使用方法  ///////////////////
    CHttpClient http;
    CString url;
    GetDlgItemText(IDC_EDIT2, url);
    CString str;
    http.HttpGet(url, str);
    AfxMessageBox(str);
複製代碼

 

 

 

轉載:https://www.cnblogs.com/Ray-chen/archive/2011/12/14/2287812.html

一、建立會話(Session)對象:

       CInternetSession mysession;

二、連接到Http服務器:

      CHttpConnection *myconn=mysession.GetHttpConnection("www.baidu.com");

三、打開Http請求:

      CHttpFile *myfile=myconn->OpenRequest("GET","/index.html");

四、發送Http請求:

      myfile->SendRequest();

五、從服務器讀取字節流(bytes):

      CString mystr;
      CString tmp;
      while(myfile->ReadString(tmp))
      {
           mystr+=tmp;
      }

六、釋放資源:

     myfile->Close();
      myconn->Close();
     mysession.Close();
     delete myfile;
     delete myconn;
     myfile=0;
     myconn=0;

     步驟基本如上,上例各函數參數主要使用默認參數,具體函數聲明請查閱MSDN。另外別忘了異常處理!

1、下載文件
Download(const CString& strFileURLInServer, //待下載文件的URL
const CString & strFileLocalFullPath)//存放到本地的路徑
{
 ASSERT(strFileURLInServer != "");
 ASSERT(strFileLocalFullPath != "");
 CInternetSession session;
 CHttpConnection* pHttpConnection = NULL;
 CHttpFile* pHttpFile = NULL;
 CString strServer, strObject;
 INTERNET_PORT wPort;

 

 DWORD dwType;
 const int nTimeOut = 2000;
 session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, nTimeOut); //重試之間的等待延時
 session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 1);   //重試次數
 char* pszBuffer = NULL;  

 

 try
 {
  AfxParseURL(strFileURLInServer, dwType, strServer, strObject, wPort);
  pHttpConnection = session.GetHttpConnection(strServer, wPort);
  pHttpFile = pHttpConnection->OpenRequest(CHttpConnection::HTTP_VERB_GET, strObject);
  if(pHttpFile->SendRequest() == FALSE)
   return false;
  DWORD dwStateCode;

 

  pHttpFile->QueryInfoStatusCode(dwStateCode);
  if(dwStateCode == HTTP_STATUS_OK)
  {
    HANDLE hFile = CreateFile(strFileLocalFullPath, GENERIC_WRITE,
         FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
         NULL);  //創建本地文件
   if(hFile == INVALID_HANDLE_VALUE)
   {
    pHttpFile->Close();
    pHttpConnection->Close();
    session.Close();
    return false;
   }
 
   char szInfoBuffer[1000];  //返回消息
   DWORD dwFileSize = 0;   //文件長度
   DWORD dwInfoBufferSize = sizeof(szInfoBuffer);
   BOOL bResult = FALSE;
   bResult = pHttpFile->QueryInfo(HTTP_QUERY_CONTENT_LENGTH,
           (void*)szInfoBuffer,&dwInfoBufferSize,NULL);

 

   dwFileSize = atoi(szInfoBuffer);
   const int BUFFER_LENGTH = 1024 * 10;
   pszBuffer = new char[BUFFER_LENGTH];  //讀取文件的緩衝
   DWORD dwWrite, dwTotalWrite;
   dwWrite = dwTotalWrite = 0;
   UINT nRead = pHttpFile->Read(pszBuffer, BUFFER_LENGTH); //讀取服務器上數據

 

   while(nRead > 0)
   {
    WriteFile(hFile, pszBuffer, nRead, &dwWrite, NULL);  //寫到本地文件
    dwTotalWrite += dwWrite;
    nRead = pHttpFile->Read(pszBuffer, BUFFER_LENGTH);
   }

 

   delete[]pszBuffer;
   pszBuffer = NULL;
   CloseHandle(hFile);
  }
  else
  {
   delete[]pszBuffer;
   pszBuffer = NULL;
   if(pHttpFile != NULL)
   {
    pHttpFile->Close();
    delete pHttpFile;
    pHttpFile = NULL;
   }
   if(pHttpConnection != NULL)
   {
    pHttpConnection->Close();
    delete pHttpConnection;
    pHttpConnection = NULL;
   }
   session.Close();
    return false;
  }
 }
 catch(...)
 {
  delete[]pszBuffer;
  pszBuffer = NULL;
  if(pHttpFile != NULL)
  {
   pHttpFile->Close();
   delete pHttpFile;
   pHttpFile = NULL;
  }
  if(pHttpConnection != NULL)
  {
   pHttpConnection->Close();
   delete pHttpConnection;
   pHttpConnection = NULL;
  }
  session.Close();
  return false;
 }

 

 if(pHttpFile != NULL)
  pHttpFile->Close();
 if(pHttpConnection != NULL)
  pHttpConnection->Close();
 session.Close();
 return true;
}

2、上傳文件
bool Download(const CString& strFileURLInServer, //待下載文件的URL
const CString & strFileLocalFullPath)//存放到本地的路徑
{
ASSERT(strFileURLInServer != "");
ASSERT(strFileLocalFullPath != "");
CInternetSession session;
CHttpConnection* pHttpConnection = NULL;
CHttpFile* pHttpFile = NULL;
CString strServer, strObject;
INTERNET_PORT wPort;
bool bReturn = false;

DWORD dwType;
const int nTimeOut = 2000;
session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, nTimeOut); //重試之間的等待延時
session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 1); //重試次數
char* pszBuffer = NULL;

try
{
AfxParseURL(strFileURLInServer, dwType, strServer, strObject, wPort);
pHttpConnection = session.GetHttpConnection(strServer, wPort);
pHttpFile = pHttpConnection->OpenRequest(CHttpConnection::HTTP_VERB_GET, strObject);
if(pHttpFile->SendRequest() == FALSE)
return false;
DWORD dwStateCode;

pHttpFile->QueryInfoStatusCode(dwStateCode);
if(dwStateCode == HTTP_STATUS_OK)
{
HANDLE hFile = CreateFile(strFileLocalFullPath, GENERIC_WRITE,
FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
NULL); //創建本地文件
if(hFile == INVALID_HANDLE_VALUE)
{
pHttpFile->Close();
pHttpConnection->Close();
session.Close();
return false;
}

char szInfoBuffer[1000]; //返回消息
DWORD dwFileSize = 0; //文件長度
DWORD dwInfoBufferSize = sizeof(szInfoBuffer);
BOOL bResult = FALSE;
bResult = pHttpFile->QueryInfo(HTTP_QUERY_CONTENT_LENGTH,
(void*)szInfoBuffer,&dwInfoBufferSize,NULL);

dwFileSize = atoi(szInfoBuffer);
const int BUFFER_LENGTH = 1024 * 10;
pszBuffer = new char[BUFFER_LENGTH]; //讀取文件的緩衝
DWORD dwWrite, dwTotalWrite;
dwWrite = dwTotalWrite = 0;
UINT nRead = pHttpFile->Read(pszBuffer, BUFFER_LENGTH); //讀取服務器上數據

while(nRead > 0)
{
WriteFile(hFile, pszBuffer, nRead, &dwWrite, NULL); //寫到本地文件
dwTotalWrite += dwWrite;
nRead = pHttpFile->Read(pszBuffer, BUFFER_LENGTH);
}

delete[]pszBuffer;
pszBuffer = NULL;
CloseHandle(hFile);
bReturn = true;
}
}
catch(CInternetException* e)
{
TCHAR tszErrString[256];
e->GetErrorMessage(tszErrString, ArraySize(tszErrString));
TRACE(_T("Download XSL error! URL: %s,Error: %s"), strFileURLInServer, tszErrString);
e->Delete();
}
catch(...)
{
}

if(pszBuffer != NULL)
{
delete[]pszBuffer;
}
if(pHttpFile != NULL)
{
pHttpFile->Close();
delete pHttpFile;
}
if(pHttpConnection != NULL)
{
pHttpConnection->Close();
delete pHttpConnection;
}
session.Close();
return bReturn;

 

******************

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章