⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 youcalldlg.cpp

📁 悠游寻呼是一个BP机短讯工具
💻 CPP
📖 第 1 页 / 共 2 页
字号:
	    head+="Accept:image/gif,image/x-xbitmap,image/jpeg,image/pjpeg,*/* \r\n";
	    head+="Content-Type:application/x-www-form-rulencoded \r\n";
	    head+="User-Agent:(compatible) \r\n";
	    head+="content-Length:";
	    len=strlen((LPCTSTR)msg);
	    itoa(len,temp,10);
	    head+=temp;
    	head+="\r\n\r\n";
    	sock.Close();
	    flag=FALSE;
	    res=sock.Create();
        res=sock.Connect("202.100.204.180",80);
	}
	case 3:{//湖南
	    msg+="FormName04=1&FormTai=1"; 
	    msg+="&CallTai="; // 台 名
	    msg+="1";
	    msg+="&FormName02="; //BP机号
	    msg+=m_callnumber;
	    msg+="&MacType="; //类   型
	    msg+=(m_type==0)?"1":"0";
	    msg+="&FormCountry="; //国 家
	    msg+=m_country;
	    msg+="&FormRegion="; //地区区号
	    msg+=m_zipcode;
	    msg+="&FormName01="; //回复电话
	    msg+=m_backnumber;
	    msg+="&TEXTAREA1="; //留言	
	    msg+=m_mysay;
	    msg+="\r\n&Page=完成"; //完成
	    head+="GET /bin_1/iserver.dll/gx_m11e HTTP/1.0 \r\n";
	    head+="Accept:image/gif,image/x-xbitmap,image/jpeg,image/pjpeg,*/* \r\n";
	    head+="Content-Type:application/x-www-form-rulencoded \r\n";
	    head+="User-Agent:(compatible) \r\n";
	    head+="content-Length:";
	    len=strlen((LPCTSTR)msg);
	    itoa(len,temp,10);
	    head+=temp;
    	head+="\r\n\r\n";
    	sock.Close();
	    flag=FALSE;
	    res=sock.Create();
        res=sock.Connect("www.hn.gnetpri.com",80);
	}
	case 4:{//上海
	    msg+="FormName04=1&FormTai=1"; 
	    msg+="&sys="; // 台 名
	    if (m_sex==0) msg+="126";
	    if (m_sex==1) msg+="127";
	    if (m_sex==2) msg+="128";
		if (m_sex==3) msg+="1250";
	    msg+="&pager="; //BP机号
	    msg+=m_callnumber;
	    msg+="&MacType="; //类   型
	    msg+=(m_type==0)?"c":"n";
	    msg+="&FormCountry="; //国 家
	    msg+=m_country;
	    msg+="&area="; //地区区号
	    msg+=m_zipcode;
	    msg+="&info="; //回复电话或留言
	    msg+=m_backnumber;
	    //msg+="&TEXTAREA1="; //留言	
	    //msg+=m_mysay;
	    msg+="\r\n&MySend=完成"; //完成
	    head+="POST /cgi-bin/callnet.cgi HTTP/1.0 \r\n";
	    head+="Accept:image/gif,image/x-xbitmap,image/jpeg,image/pjpeg,*/* \r\n";
	    head+="Content-Type:application/x-www-form-rulencoded \r\n";
	    head+="User-Agent:(compatible) \r\n";
	    head+="content-Length:";
	    len=strlen((LPCTSTR)msg);
	    itoa(len,temp,10);
	    head+=temp;
    	head+="\r\n\r\n";
    	sock.Close();
	    flag=FALSE;
	    res=sock.Create();
        res=sock.Connect("www.sh.gnetpri.com",80);
		   }
	case 5:{//黑龙江
	    msg+="FormName04=1&FormTai=1"; 
	    msg+="&FormTai="; // 台 名
	    if (m_sex==0) msg+="1";
	    if (m_sex==1) msg+="2";
	    msg+="FormName02="; //BP机号
	    msg+=m_callnumber;
	    msg+="&FormName04="; //类   型
	    msg+=(m_type==0)?"2":"1";
	    msg+="&FormCountry="; //国 家
	    msg+=m_country;
	    msg+="&FormRegion="; //地区区号
	    msg+=m_zipcode;
	    msg+="FormName01="; //回复电话或留言
	    msg+=m_backnumber;
	    msg+="&FormName032="; //留言	
	    msg+=m_mysay;
	    msg+="\r\n&MySend=完成"; //完成
	    head+="POST /netcall_1_ok1.asp HTTP/1.0 \r\n";
	    head+="Accept:image/gif,image/x-xbitmap,image/jpeg,image/pjpeg,*/* \r\n";
	    head+="Content-Type:application/x-www-form-rulencoded \r\n";
	    head+="User-Agent:(compatible) \r\n";
	    head+="content-Length:";
	    len=strlen((LPCTSTR)msg);
	    itoa(len,temp,10);
	    head+=temp;
    	head+="\r\n\r\n";
    	sock.Close();
	    flag=FALSE;
	    res=sock.Create();
        res=sock.Connect("www.hl.gnetpri.com",80);
		   }
   }
	if (!res){
		::MessageBox(m_hWnd,"无法连接到服务器!","出错了",MB_OK+MB_ICONERROR);
	    GetDlgItem(ID_CALL)->EnableWindow(TRUE);
	    return;
	}else
    {
		sock.Send(head,strlen((LPCTSTR)head));
		sock.Send(msg,strlen((LPCTSTR)msg));
		DWORD tick=::GetTickCount()+5000;
		res=0;
		while (::GetTickCount()<tick)
		{
			res+=sock.Receive(temp,sizeof(temp));
			if (res>16)
			{
				if (temp[13]=='O'&&temp[14]=='K')
				{
					::MessageBox(m_hWnd,"恭喜,寻呼已经发出!","信息",MB_OK+MB_ICONINFORMATION);					 
					flag=TRUE;
				}
				break;
			}
			else  Sleep(1); 
		}
	}
	if (flag==FALSE)::MessageBox(m_hWnd,"呼叫失败!请重新试试","错误",MB_OK+MB_ICONERROR);
	GetDlgItem(ID_CALL)->EnableWindow(TRUE);
	sock.Close(); 
}

void CYouCallDlg::OnRadio1() 
{
 m_sex=0;
 chk();
}

void CYouCallDlg::OnRadio2() 
{
 m_sex=1;
 chk();	
}

void CYouCallDlg::OnRadioCn() 
{
  m_type=0;	
  chk();
}

void CYouCallDlg::OnRadioNu() 
{
  m_type=1;	
  chk();
}

void CYouCallDlg::chk()
{
	if (m_sex==0) CheckRadioButton(IDC_RADIO1,IDC_RADIO8,IDC_RADIO1);
	if (m_sex==1) CheckRadioButton(IDC_RADIO1,IDC_RADIO8,IDC_RADIO2);
	if (m_sex==2) CheckRadioButton(IDC_RADIO1,IDC_RADIO8,IDC_RADIO3);
	if (m_sex==3) CheckRadioButton(IDC_RADIO1,IDC_RADIO8,IDC_RADIO4);
	if (m_sex==4) CheckRadioButton(IDC_RADIO1,IDC_RADIO8,IDC_RADIO5);
	if (m_sex==5) CheckRadioButton(IDC_RADIO1,IDC_RADIO8,IDC_RADIO6);
	if (m_sex==6) CheckRadioButton(IDC_RADIO1,IDC_RADIO8,IDC_RADIO7);
	if (m_sex==7) CheckRadioButton(IDC_RADIO1,IDC_RADIO8,IDC_RADIO8);
	
	
	CheckRadioButton(IDC_RADIO_CN,IDC_RADIO_NU,(m_type==0)?IDC_RADIO_CN:IDC_RADIO_NU);	
	if (m_type==1) 	GetDlgItem(IDC_EDIT_MYSAY)->EnableWindow(FALSE);
	else GetDlgItem(IDC_EDIT_MYSAY)->EnableWindow(TRUE);
}

void CYouCallDlg::OnSelchangeComboSelect() 
{
	UpdateData(TRUE);
	m_country="86";
	switch(m_select)
	{
	case 0: {
		m_zipcode="010"; 
        GetDlgItem(IDC_RADIO1)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO2)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO3)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO4)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO5)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO6)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO7)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO8)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO1)->SetWindowText("127");
		GetDlgItem(IDC_RADIO2)->SetWindowText("198/199");
		GetDlgItem(IDC_RADIO3)->SetWindowText("280");
		GetDlgItem(IDC_RADIO4)->SetWindowText("283");
		GetDlgItem(IDC_RADIO5)->SetWindowText("286/287");
		GetDlgItem(IDC_RADIO6)->SetWindowText("288/289");
		GetDlgItem(IDC_RADIO7)->SetWindowText("126");
		GetDlgItem(IDC_RADIO8)->SetWindowText("128");
		break;
	}
	case 1: {
		m_zipcode="931";m_country="086";
		GetDlgItem(IDC_RADIO1)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO2)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO3)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO4)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO5)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO6)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO7)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO8)->ShowWindow(FALSE);
        GetDlgItem(IDC_RADIO1)->SetWindowText("126/127");
		GetDlgItem(IDC_RADIO2)->SetWindowText("198/199");
		break;
	}
	case 2: {
		m_zipcode="898";
		GetDlgItem(IDC_RADIO1)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO2)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO3)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO4)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO5)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO6)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO7)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO8)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO1)->SetWindowText("126/127");
		GetDlgItem(IDC_RADIO2)->SetWindowText("128/129/990/198/199");  
		break;
	}
	case 3: {
		m_zipcode="0731";
		GetDlgItem(IDC_RADIO1)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO2)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO3)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO4)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO5)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO6)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO7)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO8)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO1)->SetWindowText("126/127");
		break;
	}
    case 4: {
		m_zipcode="";
		GetDlgItem(IDC_RADIO1)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO2)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO3)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO4)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO5)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO6)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO7)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO8)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO1)->SetWindowText("126");
		GetDlgItem(IDC_RADIO2)->SetWindowText("127");
		GetDlgItem(IDC_RADIO3)->SetWindowText("128");
		GetDlgItem(IDC_RADIO4)->SetWindowText("1250");
		break;
			}
    case 5: {
		m_zipcode="451";m_country="086";
		GetDlgItem(IDC_RADIO1)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO2)->ShowWindow(TRUE);
		GetDlgItem(IDC_RADIO3)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO4)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO5)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO6)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO7)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO8)->ShowWindow(FALSE);
		GetDlgItem(IDC_RADIO1)->SetWindowText("126/127");
		GetDlgItem(IDC_RADIO2)->SetWindowText("128/129");
		break;
			}
	}
	UpdateData(FALSE);		
}

void CYouCallDlg::OnRadio3() 
{
 m_sex=2;
 chk();		
}

void CYouCallDlg::OnRadio4() 
{
 m_sex=3;
 chk();		
}

void CYouCallDlg::OnRadio5() 
{
 m_sex=4;
 chk();		
}

void CYouCallDlg::OnRadio6() 
{
 m_sex=5;
 chk();	
}

void CYouCallDlg::OnRadio7() 
{
 m_sex=6;
 chk();		
}

void CYouCallDlg::OnRadio8() 
{
 m_sex=7;
 chk();		
}

void CAboutDlg::OnStaticHomepage() 
{
	//主页
	ShellExecute(m_hWnd,"OPEN","http://yousoft.home.chinaren.com",NULL,NULL,SW_SHOW);
}

void CAboutDlg::OnStaticMail() 
{
	//邮件
	ShellExecute(m_hWnd,"OPEN","mailto:yousoft@chinaren.com",NULL,NULL,SW_SHOW);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -