q.txt
来自「设计一套完整实用的RSA文件加密解决方案」· 文本 代码 · 共 54 行
TXT
54 行
void CQueryDlg::TryWhois(CString host)
{
CInternetSession session;
m_out += "正在链接Whois地址 " + host + "\r\n";
UpdateData(FALSE);
CGopherConnection* connection = NULL;
try
{
connection = session.GetGopherConnection("rs.internic.net",NULL,NULL,43);
}
catch (CInternetException* pEx)
{
connection = NULL;
pEx->Delete();
}
if (connection)
{
m_out += "已建立链接。 \r\n";
CGopherLocator locator = connection->CreateLocator(NULL, host, GOPHER_TYPE_TEXT_FILE);
CGopherFile* file = NULL;
try
{
file = connection->OpenFile(locator);
}
catch (CInternetException* pEx)
{
file = NULL;
pEx->Delete();
}
if (file)
{
CString line;
for (int i=0; i < 20 && file->ReadString(line); i++)
{
m_out += line + "\r\n";
}
file->Close();
delete file;
}
else
{
m_out+="Whois查询失败。\r\n";
}
connection->Close();
delete connection;
}
else
{
m_out += "Whois查询失败。\r\n";
}
m_out += "------------------------------------------------------\r\n";
UpdateData(FALSE);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?