Example #1
0
HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_id(BSTR v)
{
    nsCOMPtr<nsIDOMHTMLElement> domHtmlElmt = do_QueryInterface(mDOMNode);
    if (!domHtmlElmt)
        return E_UNEXPECTED;
    USES_CONVERSION;
    nsDependentString strID(OLE2CW(v));
    if (FAILED(domHtmlElmt->SetId(strID)))
        return E_FAIL;
    return S_OK;
}
Example #2
0
bool CSMClient::LoadMapFileSetup(CDataBlockAllocator *pDBAllocator)
{
	string strTempt("");
	string strID("");
	string strMapObjName("");
	ifstream stream;
	stream.open("MapFileSetup.ini");
	if( stream.is_open() )
	{
		stream  >> strTempt>> strID
			>> strTempt >> strMapObjName;
		GetGame()->GetSetup()->dwGappID = atoi(strID.c_str());
		m_bMapFile=GetInst(CMemClient).Initial(
			strMapObjName.c_str(), pDBAllocator);
		if (!m_bMapFile)
		{
			AddLogText("没有启动SM,不能记录相关日志!");
		}
	}
Example #3
0
bool CSMClient::LoadMapFileSetup(CDataBlockAllocator *pDBAllocator)
{
    bool res = true;
	string strTempt("");
	string strID("");
	string strMapObjName("");
	ifstream stream;
	stream.open("MapFileSetup.ini");
	if( stream.is_open() )
	{
		stream  >> strTempt>> strID
			>> strTempt >> strMapObjName;
		m_bMapFile=GetInst(CMemClient).Initial(strMapObjName.c_str(),
            pDBAllocator);
		if (!m_bMapFile)
		{
            res = false;
			Log4c::Warn(ROOT_MODULE, GetText("GAME_SYS_SMDISABLE"));
		}
		stream.close();
	}	
int C51JobWebPost::GetHtmlCtrl(IHTMLDocument2 *pDoc2)
{
	if(pDoc2==NULL)
	{
		return 0;
	}
	IHTMLElementCollection   *pColl=NULL;
	HRESULT hr=pDoc2->get_all(&pColl);
	if(SUCCEEDED(hr)   &&   pColl!=NULL)   
	{   
		long   lcount   =   0;   
		pColl->get_length(&lcount);
		CString strName = "name";
		BSTR bstrText = strName.AllocSysString();
		//CString strValue = "onfocus";
		//BSTR bstrValue = strName.AllocSysString();
		int iFindCount = 0;
		for(int i=0;i<lcount;i++)   
		{
			if (iFindCount >= 8)
			{
				//break;
			}
			CComVariant   index;   
			index.vt=VT_I4;   
			index.intVal=i;   
			CComPtr<IDispatch>   disp;   
			pColl->item(index,index,&disp);   
			if(disp==NULL)   
				hr=E_FAIL;   
			else   
			{
				CComPtr<IHTMLElement>   pElement;
				//CComPtr<IHTMLImgElement> pImg;
				hr=disp->QueryInterface(IID_IHTMLElement,
					(void**)&pElement);
				if(SUCCEEDED(hr))   
				{   
					BSTR   bstrID;					
					pElement->get_id(&bstrID);
					CString strID(bstrID);
					VARIANT  varValue;
					pElement->getAttribute(bstrText,0,&varValue);
					strID.MakeLower();
					//pElement->
// 					CString strValue = "";
// 					if (varValue.vt == VT_BSTR)
// 					{
// 						strValue.Format ("%s",(const char*)(_bstr_t)(_variant_t)varValue);
// 					}
// 					strValue.MakeLower();
// 					ShowMessage(strValue);
// 					if (strID == "imgReg")
// 					{
// 						ShowMessage("找到注册按钮");
// 						//m_pRegBtn = pElement;
// 						iFindCount ++;
// 						//pElement->click();
// 					}
// 					else if (strID == "introducer")
// 					{
// 						ShowMessage("找到推荐人输入框");
// 						//pElement->setAttribute(bstrValue,"aa",0);
// 						//pElement->
// 						//pUserIntroman = (CComPtr<IHTMLInputTextElement>)pElement;
// 						iFindCount ++;
// 					}
					if (strID == "machineserial")		//email name repassword password
					{
						//ShowMessage("找到MAC地址隐藏域");
						m_strMac = GetElementValue(pElement);
						ShowMessage(m_strMac);
						//iFindCount ++;
					}
// 					else if (strID == "username")		
// 					{
// 						ShowMessage("找到USERNAME");
// 						iFindCount ++;
// 					}
// 					else if (strID == "userpwd")
// 					{
// 						ShowMessage("找到密码");
// 						iFindCount ++;
// 					}
// 					else if (strID == "repassword" || strValue == "repassword")
// 					{
// 						ShowMessage("找到密码确认");
// 						iFindCount ++;
// 					}
// 					else if (strID == "checkcode" || strValue == "checkcode")
// 					{
// 						ShowMessage("找到验证码");
// 						iFindCount ++;
// 					}
					else if (strID == "transactionid")
					{
						//找到TRANS
						//ShowMessage("找到TRANS");
						m_strTrans = GetElementValue(pElement);
						ShowMessage(m_strTrans);
					}
					else if (strID == "verify")
					{
						//找到VERIFY
						//ShowMessage("找到verify");
						m_strVerify = GetElementValue(pElement);
						ShowMessage(m_strVerify);
						break;
					}
				}
			}
		}
		::SysFreeString(bstrText);
		pColl->Release();   
	}   
	pDoc2->Release();
	return 0;
}
Example #5
0
pal::string_t pal::get_current_os_rid_platform()
{
    pal::string_t ridOS;
    pal::string_t versionFile(_X("/etc/os-release"));

    if (pal::file_exists(versionFile))
    {
        // Read the file to get ID and VERSION_ID data that will be used
        // to construct the RID.
        std::fstream fsVersionFile;
        
        fsVersionFile.open(versionFile, std::fstream::in);

        // Proceed only if we were able to open the file
        if (fsVersionFile.good())
        {
            pal::string_t line;
            pal::string_t strID(_X("ID="));
            pal::string_t valID;
            pal::string_t strVersionID(_X("VERSION_ID="));
            pal::string_t valVersionID;

            bool fFoundID = false, fFoundVersion = false;

            // Read the first line
            std::getline(fsVersionFile, line);

            // Loop until we are at the end of file
            while (!fsVersionFile.eof())
            {
                // Look for ID if we have not found it already
                if (!fFoundID)
                {
                    size_t pos = line.find(strID);
                    if ((pos != std::string::npos) && (pos == 0))
                    {
                        valID.append(line.substr(3));
                        fFoundID = true;
                    }
                }

                // Look for VersionID if we have not found it already
                if (!fFoundVersion)
                {
                    size_t pos = line.find(strVersionID);
                    if ((pos != std::string::npos) && (pos == 0))
                    {
                        valVersionID.append(line.substr(11));
                        fFoundVersion = true;
                    }
                }

                if (fFoundID && fFoundVersion)
                {
                    // We have everything we need to form the RID - break out of the loop.
                    break;
                }

                // Read the next line
                std::getline(fsVersionFile, line);
            }

            // Close the file now that we are done with it.
            fsVersionFile.close();

            if (fFoundID)
            {
                ridOS.append(valID);
            }
            
            if (fFoundVersion)
            {
                ridOS.append(_X("."));
                ridOS.append(valVersionID);
            }

            if (fFoundID || fFoundVersion)
            {
                // Remove any double-quotes
                ridOS = trim_quotes(ridOS);
            }
        }
    }

    return normalize_linux_rid(ridOS);
}
int C51JobWebPost::GetHtmlCtrl(IHTMLDocument2 *pDoc2)
{
	if(pDoc2==NULL)
	{
		return 0;
	}
	IHTMLElementCollection   *pColl=NULL;
	HRESULT hr=pDoc2->get_all(&pColl);
	if(SUCCEEDED(hr)   &&   pColl!=NULL)   
	{   
		long   lcount   =   0;   
		pColl->get_length(&lcount);
		CString strName = "name";
		BSTR bstrText = strName.AllocSysString();
		int iFindCount = 0;
		for(int i=0;i<lcount;i++)   
		{
			if (iFindCount >= 8)
			{
				//break;
			}
			CComVariant   index;   
			index.vt=VT_I4;   
			index.intVal=i;   
			CComPtr<IDispatch>   disp;   
			pColl->item(index,index,&disp);   
			if(disp==NULL)   
				hr=E_FAIL;   
			else   
			{
				CComPtr<IHTMLElement>   pElement;
				hr=disp->QueryInterface(IID_IHTMLElement,
					(void**)&pElement);
				if(SUCCEEDED(hr))   
				{   
					BSTR   bstrID;					
					pElement->get_id(&bstrID);
					CString strID(bstrID);
					VARIANT  varValue;
					pElement->getAttribute(bstrText,0,&varValue);
					strID.MakeLower();
					if (strID == "machineserial")		//email name repassword password
					{
						m_strMac = GetElementValue(pElement);
						ShowMessage(m_strMac);
					}
					else if (strID == "transactionid")
					{
						m_strTrans = GetElementValue(pElement);
						ShowMessage(m_strTrans);
					}
					else if (strID == "verify")
					{
						//找到VERIFY
						//ShowMessage("找到verify");
						m_strVerify = GetElementValue(pElement);
						ShowMessage(m_strVerify);
						break;
					}
				}
			}
		}
		::SysFreeString(bstrText);
		pColl->Release();   
	}   
	pDoc2->Release();
	return 0;
}