// --------------------------------------------------------------------------- #include #pragma hdrstop #include "WebActivation_F.h" #include "common.h" #include "Define.h" // --------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "IdBaseComponent" #pragma link "IdComponent" #pragma link "IdHTTP" #pragma link "IdTCPClient" #pragma link "IdTCPConnection" #pragma link "RzButton" #pragma link "RzEdit" #pragma link "RzLabel" #pragma link "RzRadChk" #pragma link "RzSpnEdt" #pragma resource "*.dfm" // --------------------------------------------------------------------------- #define IDS_KEY_SUCCESS StringTable[0] #define IDS_DEFICIENT_PARAM StringTable[1] #define IDS_INVALID_USETERM StringTable[2] #define IDS_INVALID_EMAIL StringTable[3] #define IDS_UNREGISTERD_EMAIL StringTable[4] #define IDS_INVALID_KEY StringTable[5] #define IDS_ACTIVATION_SUCCESS StringTable[6] #define IDS_ACTIVATION_CANCLE StringTable[7] #define IDS_ACTIVATION_EXIT StringTable[8] #define IDS_ACTVFORM_CAPTION StringTable[9] #define IDS_ACTVFORM_USERNAME StringTable[10] #define IDS_ACTVFORM_EMAIL StringTable[11] #define IDS_ACTVFORM_COMPANY StringTable[12] #define IDS_ACTVFORM_GROUP StringTable[13] #define IDS_ACTVFORM_DURATION StringTable[14] #define IDS_ACTVFORM_GETAKEY StringTable[15] #define IDS_ACTVFORM_INPUTAKEY StringTable[16] #define IDS_ACTVFORM_ACTIVATE StringTable[17] #define IDS_TEMPFORM_CAPTION StringTable[18] #define IDS_NOT_APPOINTED_TIME StringTable[19] #define IDS_CONFIRM_CAPTION StringTable[20] #define IDS_REMEMBER_ME StringTable[21] #define IDS_UNIT_DAY StringTable[22] #define IDS_CONFIRM_QUESTION StringTable[23] #define IDS_NET_WARNING_CAPTION StringTable[24] #define IDS_NET_WARNING_MESSAGE StringTable[25] #define IDS_OFFLINE_MESSAGE StringTable[26] #define IDS_NET_WARNING_OK StringTable[27] // --------------------------------------------------------------------------- #define _CB2010_ // C++ Builder 6¿Í 2010¿¡¼­ ´Ù¸£°Ô ó¸®ÇؾßÇÏ´Â ºÎºÐÀÌ ÀÖ¾î define ó¸®ÇÏ¿´À½. TActivationDialogForm *ActivationDialogForm; // --------------------------------------------------------------------------- __fastcall TActivationDialogForm::TActivationDialogForm(TComponent* Owner) : TForm(Owner) { Owner_chRenew = Owner; StringTable.Create(DirectoryBin, Language, _T("WebActivation")); MACaddress = GetMACaddress(); LogForAdd = new ActvLog(Application); #ifdef EDU_ASP step = 0; this->BorderStyle = Forms::bsNone; /* inpName->Visible = false; inpEmail->Visible = false; inpGroup->Visible = false; inpPart->Visible = false; rzbtnGetKey->Visible = false; inpAkey->Visible = false; rzbtnEnterKey->Visible = false; imgBackground->Visible = false; CheckRemember->Visible = false; inpUsetime->Visible = false; rzlbUsetime->Visible = false; imgCancel->Top -= ImageEduBg->Top; imgGetKey->Top -= ImageEduBg->Top; imgInput->Top -= ImageEduBg->Top; imgLogin->Top -= ImageEduBg->Top; lbOrderNumber->Top -= ImageEduBg->Top; cbOrderNumber->Top -= ImageEduBg->Top; lbProductName->Top -= ImageEduBg->Top; lbSelectedProduct->Top -= ImageEduBg->Top; leAKey->Top -= ImageEduBg->Top; leID->Top -= ImageEduBg->Top; lePW->Top -= ImageEduBg->Top; mmInfo->Top -= ImageEduBg->Top; ImageEduBg->Top = 0; ImageEduBg->Left = 0; this->Width = ImageEduBg->ClientWidth; this->Height = ImageEduBg->ClientHeight; */ pnEDUASP->Top = 0; pnEDUASP->Left = 0; pnEDUASP->BringToFront(); pnEDUASP->Width = 504; pnEDUASP->Height = 346; this->Width = pnEDUASP->Width; this->Height = pnEDUASP->Height; useTimeList = new TStringList; payDateList = new TStringList; #else this->Width = 471; this->Height = 349; #endif } // --------------------------------------------------------------------------- void __fastcall TActivationDialogForm::rzbtnGetKeyClick(TObject *Sender) { // »ç¿ëÀÚ Á¤º¸ ÀÔ·Â ÈÄ ÀÎÁõŰ ¹Þ±â (¸ÞÀÏ ¹ß¼Û) if (CheckRemember->Checked) { TIniFile *IniFile; String IniFilePath = AppDataBin + "\\" + WEB_INFO_INI; IniFile = new TIniFile(IniFilePath); String Section = "WEB_INFO"; IniFile->WriteString(Section, _T("Name"), inpName->Text); IniFile->WriteString(Section, _T("Email"), inpEmail->Text); IniFile->WriteString(Section, _T("Group"), inpGroup->Text); IniFile->WriteString(Section, _T("Part"), inpPart->Text); delete IniFile; } int nUsetime = 0; if (inpName->Text == _T("") || inpEmail->Text == _T("")) { Application->MessageBox(IDS_DEFICIENT_PARAM.c_str(), _T("FAIL"), MB_OK); return; } TCHAR Conf_Text[1024]; if (rzckUnlimited->Checked) { nUsetime = 1000; _stprintf(Conf_Text, _T( "%s\t: %s\n%s\t: %s\n%s\t: %s\n%s\t: %s\n%s\t: %s \n\n%s"), IDS_ACTVFORM_USERNAME.c_str(), inpName->Text.c_str(), IDS_ACTVFORM_EMAIL.c_str(), inpEmail->Text.c_str(), IDS_ACTVFORM_COMPANY.c_str(), inpGroup->Text.c_str(), IDS_ACTVFORM_GROUP.c_str(), inpPart->Text.c_str(), IDS_ACTVFORM_DURATION.c_str(), L"Unlimited", IDS_CONFIRM_QUESTION.c_str()); } else { nUsetime = inpUsetime->Value; _stprintf(Conf_Text, _T( "%s\t: %s\n%s\t: %s\n%s\t: %s\n%s\t: %s\n%s\t: %d %s\n\n%s"), IDS_ACTVFORM_USERNAME.c_str(), inpName->Text.c_str(), IDS_ACTVFORM_EMAIL.c_str(), inpEmail->Text.c_str(), IDS_ACTVFORM_COMPANY.c_str(), inpGroup->Text.c_str(), IDS_ACTVFORM_GROUP.c_str(), inpPart->Text.c_str(), IDS_ACTVFORM_DURATION.c_str(), nUsetime, IDS_UNIT_DAY.c_str(), IDS_CONFIRM_QUESTION.c_str()); } if (Application->MessageBox(Conf_Text, IDS_CONFIRM_CAPTION.c_str(), MB_YESNO) == IDNO) return; // C++ Builder 2010¿¡¼­´Â ÇÑ±Û ±úÁüÀÌ ÀϾ¼­ // 10.2 ¿Í 11.0 ¿¡¼­ ´Ù¸£°Ô ó¸®ÇÔ. #ifdef _CB2010_ // C++ Builder 2010 TIdHTTP *IdHTTP = new TIdHTTP(this); TStringStream* pData = new TStringStream(); String request, response; // make request data request = "name=" + inpName->Text; request += "&email=" + inpEmail->Text; request += "&group=" + inpGroup->Text; request += "&part=" + inpPart->Text; request += "&usetime=" + IntToStr(nUsetime); request = request + "&program=" + PROGRAM; request = request + "&version=" + VERSION; request += "&hddserial=" + MACaddress; // make request string stream pData->WriteString(request); IdHTTP->Request->ContentType = "application/x-www-form-urlencoded"; try { response = IdHTTP->Post(ADDRESS_SUBMIT, pData); } catch(...) { response = "CONNECTION_ERROR"; } #else // C++ Builder 6 TIdHTTP *IdHTTP = new TIdHTTP(this); TIdMultiPartFormDataStream* pData = NULL; String response; pData = new TIdMultiPartFormDataStream(); pData->AddFormField("name", inpName->Text); pData->AddFormField("email", inpEmail->Text); pData->AddFormField("group", inpGroup->Text); pData->AddFormField("part", inpPart->Text); pData->AddFormField("usetime", nUsetime); pData->AddFormField("program", PROGRAM); pData->AddFormField("version", VERSION); pData->AddFormField("hddserial", MACaddress); try { response = IdHTTP->Post(ADDRESS_SUBMIT, pData); } catch(...) { response = "CONNECTION_ERROR"; } #endif if (response == "SUCCESS") Application->MessageBox(IDS_KEY_SUCCESS.c_str(), _T("SUCCESS"), MB_OK); else if (response == "DEFICIENT_PARAMETER") Application->MessageBox(IDS_DEFICIENT_PARAM.c_str(), _T("FAIL"), MB_OK); else if (response == "INVALID_USETIME") Application->MessageBox(IDS_INVALID_USETERM.c_str(), _T("FAIL"), MB_OK); else if (response == "INVALID_EMAIL") Application->MessageBox(IDS_INVALID_EMAIL.c_str(), _T("FAIL"), MB_OK); else if (response == "UNREGISTERED_EMAIL") Application->MessageBox(IDS_UNREGISTERD_EMAIL.c_str(), _T("FAIL"), MB_OK); else if (response == "CONNECTION_ERROR") Application->MessageBox(IDS_OFFLINE_MESSAGE.c_str(), _T("ERROR"), MB_OK); else Application->MessageBox(IDS_OFFLINE_MESSAGE.c_str(), _T("ERROR"), MB_OK); delete pData; pData = NULL; delete IdHTTP; } // --------------------------------------------------------------------------- // Activation Key ÀÔ·Â void __fastcall TActivationDialogForm::rzbtnEnterKeyClick(TObject *Sender) { String key, mac, pcode; key = inpAkey->Text; // [ Unhashed key ] óÀ½8digit : MACaddress, ¸¶Áö¸·5digit : Program&Version mac = keyHash(key).SubString(1, 8); pcode = keyHash(key).SubString(21, 5); // remove * character from the start of the string while (pcode.c_str()[0] == '*') { pcode = pcode.SubString(2, pcode.Length() - 1); } if (!(mac == MACaddress.SubString(1, 8)) || !(pcode == PRG_VSN)) { Application->MessageBox(IDS_INVALID_KEY.c_str(), _T("FAIL"), MB_OK); return; } TIdHTTP *IdHTTP = new TIdHTTP(this); TIdMultiPartFormDataStream* pData = NULL; String response; pData = new TIdMultiPartFormDataStream(); pData->AddFormField("akey", inpAkey->Text); try { response = IdHTTP->Post(ADDRESS_COMMIT, pData); } catch(...) { response = "CONNECTION_ERROR"; } if (response == "SUCCESS") { Application->MessageBox(IDS_ACTIVATION_SUCCESS.c_str(), _T("SUCCESS"), MB_OK); LogForAdd->AddLog(); ModalResult = mrOk; return; } else if (response == "INVALID_ACTIVATION_KEY") Application->MessageBox(IDS_INVALID_KEY.c_str(), _T("FAIL"), MB_OK); else if (response == "CONNECTION_ERROR") Application->MessageBox(IDS_OFFLINE_MESSAGE.c_str(), _T("ERROR"), MB_OK); else Application->MessageBox(IDS_OFFLINE_MESSAGE.c_str(), _T("ERROR"), MB_OK); delete pData; pData = NULL; delete IdHTTP; } // --------------------------------------------------------------------------- void __fastcall TActivationDialogForm::FormCloseQuery(TObject *Sender, bool &CanClose) { int YesOrNo = true; if (ModalResult == mrOk) { CanClose = true; return; } if (Owner_chRenew != NULL) { YesOrNo = Application->MessageBox(IDS_ACTIVATION_EXIT.c_str(), IDS_ACTIVATION_CANCLE.c_str(), MB_YESNO); CanClose = (YesOrNo == IDYES); } } // --------------------------------------------------------------------------- void __fastcall TActivationDialogForm::FormCreate(TObject *Sender) { Caption = IDS_ACTVFORM_CAPTION; #ifdef EDU_ASP #else inpName->EditLabel->Caption = IDS_ACTVFORM_USERNAME; inpEmail->EditLabel->Caption = IDS_ACTVFORM_EMAIL; inpGroup->EditLabel->Caption = IDS_ACTVFORM_COMPANY; inpPart->EditLabel->Caption = IDS_ACTVFORM_GROUP; rzlbUsetime->Caption = IDS_ACTVFORM_DURATION; rzbtnGetKey->Caption = IDS_ACTVFORM_GETAKEY; inpAkey->EditLabel->Caption = IDS_ACTVFORM_INPUTAKEY; rzbtnEnterKey->Caption = IDS_ACTVFORM_ACTIVATE; imgBackground->Picture->LoadFromFile(DirectoryBin + "\\activation.bmp"); //CheckRemember->Caption = IDS_REMEMBER_ME; #endif rzlbUsetime->Left = (inpPart->Left - inpPart->LabelSpacing) - rzlbUsetime->Width; // ±â¾ïµÈ Á¤º¸ ºÒ·¯ ¿À±â TIniFile *IniFile; String IniFilePath = AppDataBin + "\\" + WEB_INFO_INI; IniFile = new TIniFile(IniFilePath); String Section = "WEB_INFO"; inpName->Text = IniFile->ReadString(Section, _T("Name"), _T("")); inpEmail->Text = IniFile->ReadString(Section, _T("Email"), _T("")); inpGroup->Text = IniFile->ReadString(Section, _T("Group"), _T("")); inpPart->Text = IniFile->ReadString(Section, _T("Part"), _T("")); int poz = inpEmail->Text.Pos("texclub.com"); String email = inpEmail->Text.SubString(poz, inpEmail->Text.Length()-poz+1); if (email == "texclub.com") rzckUnlimited->Visible = true; delete IniFile; } // --------------------------------------------------------------------------- void __fastcall TActivationDialogForm::FormDestroy(TObject *Sender) { if (LogForAdd) { delete LogForAdd; LogForAdd = NULL; } if (useTimeList) delete useTimeList; if (payDateList) delete payDateList; } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- void __fastcall TActivationDialogForm::ParseJson(String wstrResponse) { int length = wstrResponse.Length(); WideString key, value, temp; bool bStart = false; wchar_t wtChar; for (int i = 0; i < length; i++) { wtChar = wstrResponse.c_str()[i]; if (wtChar == '{') continue; if (wtChar == '"') { bStart = !bStart; continue; } if (wtChar == ':') { if (!bStart) { key = temp; temp = ""; continue; } } if (wtChar == ',' || wtChar == '}') { value = temp; temp = ""; JsonHTTP[key] = value; continue; } if (wtChar == ' ' && !bStart) continue; temp += (WideString)wtChar; } } //--------------------------------------------------------------------------- // Education ASP Login void __fastcall TActivationDialogForm::imgLoginClick(TObject *Sender) { if (step > 0) return;//·Î±×ÀÎ ÀÌÈÄ¿¡´Â ´Ù½Ã ·Î±×ÀÎ ÇÏÁö ¾Êµµ·Ï ó¸® if(!checkInetConnect()) { mmInfo->Clear(); mmInfo->Lines->Add("ÀÎÅͳÝÀÌ ¿¬°áµÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù."); mmInfo->Lines->Add("¿¬°á È®ÀÎ ÈÄ¿¡ ½ÃµµÇϽñ⠹ٶø´Ï´Ù."); return; } TIdHTTP *IdHTTP = new TIdHTTP(this); TStringStream* pData = new TStringStream(); String request, response; bool bSuccess = true; // make request data request = "id=" + leID->Text; request += "&pw=" + lePW->Text; request = request + "&program=" + PROGRAM; request = request + "&version=" + VERSION; // make request string stream pData->WriteString(request); try { IdHTTP->Request->ContentType = "application/x-www-form-urlencoded"; #ifdef EDU_ASP response = IdHTTP->Post(ASSRESS_LOGIN, pData); #endif } catch(const Exception& e) { bSuccess = false; if (IdHTTP) delete IdHTTP; IdHTTP = NULL; if (pData) delete pData; pData = NULL; }/* __finally { if (IdHTTP) delete IdHTTP; if (pData) delete pData; if (!bSuccess) { mmInfo->Clear(); mmInfo->Lines->Add("LOGIN Á¤º¸¸¦ °¡Á®¿À´Âµ¥ ½ÇÆÐ¸¦ Çß½À´Ï´Ù."); return; } } */ if (IdHTTP) delete IdHTTP; IdHTTP = NULL; if (pData) delete pData; pData = NULL; if (!bSuccess) { mmInfo->Clear(); mmInfo->Lines->Add("LOGIN Á¤º¸¸¦ °¡Á®¿À´Âµ¥ ½ÇÆÐ¸¦ Çß½À´Ï´Ù."); return; } if (JsonHTTP.size()) JsonHTTP.clear(); ParseJson(response); String temp = GetJsonHTTP("count"); int count = 0; if (!temp.IsEmpty()) count = temp.ToInt(); else { // post ½ÇÆÐ mmInfo->Clear(); mmInfo->Lines->Add("LOGIN Á¤º¸¸¦ °¡Á®¿À´Âµ¥ ½ÇÆÐ¸¦ Çß½À´Ï´Ù."); return; } if (count == -1) {//·Î±×ÀÎ ½ÇÆÐ mmInfo->Clear(); mmInfo->Lines->Add("LOGIN ½ÇÆÐÇß½À´Ï´Ù.¾ÆÀ̵ð¿Í ºñ¹Ð¹øÈ£¸¦ È®ÀÎÇϽñ⠹ٶø´Ï´Ù."); mmInfo->Lines->Add("(ÁÖ)¿µ¿ì¾¾¿£¾ÆÀÌ È¨ÆäÀÌÁö(www.texclub.com) °¡ÀÔ ¾ÆÀ̵ð¿Í ºñ¹Ð¹øÈ£¸¦ ÀÌ¿ëÇϼ¼¿ä."); return; } else if (count == 0) { mmInfo->Clear(); mmInfo->Lines->Add("±¸¸Å ³»¿ªÀÌ ¾ø½À´Ï´Ù."); mmInfo->Lines->Add("(ÁÖ)¿µ¿ì¾¾¿£¾ÆÀÌ È¨ÆäÀÌÁö(www.texclub.com)¿¡¼­ Á¦Ç°À» ±¸¸ÅÇϽðí ÀÌ¿ëÇϽñ⠹ٶø´Ï´Ù."); } else { mmInfo->Clear(); mmInfo->Lines->Add("·Î±×ÀÎ µÇ¾ú½À´Ï´Ù."); mmInfo->Lines->Add("±¸¸Å¹øÈ£¸¦ ¼±ÅÃÇϽðí \"ÀÎÁõŰ ¹Þ±â\" ¹öưÀ» ´©¸£½Ã±â ¹Ù¶ø´Ï´Ù."); lbOrderNumber->Enabled = true; cbOrderNumber->Enabled = true; lbProductName->Enabled = true; lbSelectedProduct->Enabled = true; cbOrderNumber->Items->Clear(); for (int i=0; iItems->Add(GetJsonHTTP("no"+IntToStr(i+1))); useTimeList->Add(GetJsonHTTP("usetime"+IntToStr(i+1))); payDateList->Add(GetJsonHTTP("paydate"+IntToStr(i+1))); } leID->Enabled = false; lePW->Enabled = false; imgLogin->OnClick = NULL; cbOrderNumber->ItemIndex = 0; lbSelectedProduct->Caption = MakeProductName(0); step = 1; //login pass } } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgCancelClick(TObject *Sender) { this->ModalResult = mrCancel; //Close(); } //--------------------------------------------------------------------------- String __fastcall TActivationDialogForm::MakeProductName(int index) { String productName; productName = PROGRAM; productName += " v"; productName += VERSION; productName += " "; productName += "(" + useTimeList->Strings[index] + "ÀÏ »ç¿ë±Ç), "; productName += "±¸¸Å ÀϽÃ: "; productName += payDateList->Strings[index]; return productName; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgGetKeyClick(TObject *Sender) { if (step == 0) return; TIdHTTP *IdHTTP = new TIdHTTP(this); TStringStream* pData = new TStringStream(); String request, response; bool bSuccess = true; // make request data request = "oid=" + cbOrderNumber->Text; request = request + "&macaddr=" + MACaddress; request = request + "&program=" + PROGRAM; request = request + "&version=" + VERSION; // make request string stream pData->WriteString(request); try { IdHTTP->Request->ContentType = "application/x-www-form-urlencoded"; response = IdHTTP->Post(ADDRESS_SUBMIT, pData); } catch(const Exception& e) { bSuccess = false; if (IdHTTP) delete IdHTTP; IdHTTP = NULL; if (pData) delete pData; pData = NULL; }/* __finally { if (IdHTTP) delete IdHTTP; if (pData) delete pData; if (!bSuccess) { mmInfo->Clear(); mmInfo->Lines->Add("LOGIN Á¤º¸¸¦ °¡Á®¿À´Âµ¥ ½ÇÆÐ¸¦ Çß½À´Ï´Ù."); return; } } */ if (IdHTTP) delete IdHTTP; IdHTTP = NULL; if (pData) delete pData; pData = NULL; if (!bSuccess) { mmInfo->Clear(); mmInfo->Lines->Add("Á¤º¸¸¦ ó¸®Çϴµ¥ ½ÇÆÐÇß½À´Ï´Ù. ´Ù½Ã ½ÃµµÇϽñ⠹ٶø´Ï´Ù."); return; } if (JsonHTTP.size()) JsonHTTP.clear(); ParseJson(response); String temp = GetJsonHTTP("success"); if (temp != "true") { // post ½ÇÆÐ mmInfo->Clear(); mmInfo->Lines->Add("Á¤º¸¸¦ ó¸®Çϴµ¥ ½ÇÆÐÇß½À´Ï´Ù. ´Ù½Ã ½ÃµµÇϽñ⠹ٶø´Ï´Ù."); return; } temp = GetJsonHTTP("email"); mmInfo->Clear(); mmInfo->Lines->Add("À̸ÞÀÏ ÁÖ¼Ò \"" + temp +"\"·Î Key°¡ ¹ß¼ÛµÇ¾ú½À´Ï´Ù."); mmInfo->Lines->Add("À̸ÞÀÏ¿¡¼­ Key¸¦ È®ÀÎÇϽðí \"Activation Key ÀÔ·Â\" ¹Ú½º¿¡ ÀÔ·ÂÇϼ¼¿ä."); mmInfo->Lines->Add("\"½ÇÇà\" ¹öưÀ» ´©¸£½Ã¸é ÇÁ·Î±×·¥ »ç¿ëÀÌ ½ÃÀ۵˴ϴÙ."); //imgGetKey->OnClick = NULL; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::cbOrderNumberCloseUp(TObject *Sender) { lbSelectedProduct->Caption = MakeProductName(cbOrderNumber->ItemIndex); } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::lePWKeyPress(TObject *Sender, wchar_t &Key) { if (Key == VK_RETURN) { imgLoginClick(this); } } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgLoginMouseEnter(TObject *Sender) { if (step > 0) return;//login ÀÌÈÄ¿¡´Â ºñȰ¼ºÈ­ ó¸® Screen->Cursor = crHandPoint; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgLoginMouseLeave(TObject *Sender) { Screen->Cursor = crDefault; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgCancelMouseEnter(TObject *Sender) { Screen->Cursor = crHandPoint; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgCancelMouseLeave(TObject *Sender) { Screen->Cursor = crDefault; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgGetKeyMouseEnter(TObject *Sender) { if (step == 0) return;//login ÀÌÈÄ¿¡ Ȱ¼ºÈ­ ó¸® Screen->Cursor = crHandPoint; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgGetKeyMouseLeave(TObject *Sender) { Screen->Cursor = crDefault; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgInputMouseEnter(TObject *Sender) { if (step == 0) return;//login ÀÌÈÄ¿¡ Ȱ¼ºÈ­ ó¸® Screen->Cursor = crHandPoint; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgInputMouseLeave(TObject *Sender) { Screen->Cursor = crDefault; } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::imgInputClick(TObject *Sender) { if (step == 0) return; TIdHTTP *IdHTTP = new TIdHTTP(this); TStringStream* pData = new TStringStream(); String request, response; bool bSuccess = true; String aKey = leAKey->Text.Trim(); // make request data request = "oid=" + cbOrderNumber->Text; request = request + "&akey=" + aKey; // make request string stream pData->WriteString(request); try { IdHTTP->Request->ContentType = "application/x-www-form-urlencoded"; response = IdHTTP->Post(ADDRESS_COMMIT, pData); } catch(const Exception& e) { bSuccess = false; if (IdHTTP) delete IdHTTP; IdHTTP = NULL; if (pData) delete pData; pData = NULL; }/* __finally { if (IdHTTP) delete IdHTTP; if (pData) delete pData; if (!bSuccess) { mmInfo->Clear(); mmInfo->Lines->Add("LOGIN Á¤º¸¸¦ °¡Á®¿À´Âµ¥ ½ÇÆÐ¸¦ Çß½À´Ï´Ù."); return; } } */ if (IdHTTP) delete IdHTTP; IdHTTP = NULL; if (pData) delete pData; pData = NULL; if (!bSuccess) { mmInfo->Clear(); mmInfo->Lines->Add("Á¤º¸¸¦ ó¸®Çϴµ¥ ½ÇÆÐÇß½À´Ï´Ù. ´Ù½Ã ½ÃµµÇϽñ⠹ٶø´Ï´Ù."); return; } if (JsonHTTP.size()) JsonHTTP.clear(); //text·Î return µÇ±â ¶§¹®¿¡ jsonÀ» »ç¿ëÇÏÁö ¾Ê´Â´Ù. //ParseJson(response); //String temp = GetJsonHTTP("success"); if (response != "success") { // post ½ÇÆÐ mmInfo->Clear(); mmInfo->Lines->Add("Á¤º¸¸¦ ó¸®Çϴµ¥ ½ÇÆÐÇß½À´Ï´Ù. ´Ù½Ã ½ÃµµÇϽñ⠹ٶø´Ï´Ù."); return; } //Application->MessageBox(IDS_ACTIVATION_SUCCESS.c_str(), _T("SUCCESS"), // MB_OK); LogForAdd->AddLog(); ModalResult = mrOk; //Close(); } //--------------------------------------------------------------------------- void __fastcall TActivationDialogForm::inpEmailExit(TObject *Sender) { int poz = inpEmail->Text.Pos("texclub.com"); String email = inpEmail->Text.SubString(poz, inpEmail->Text.Length()-poz+1); if (email == "texclub.com") rzckUnlimited->Visible = true; else { rzckUnlimited->Visible = false; rzckUnlimited->Checked = false; } } //---------------------------------------------------------------------------