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

📄 tlookup_name.cpp

📁 VC++编写的类似Sniffer的网络数据包监听程序
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Tlookup_name.h"
#include "main.h"
#include "function_1.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------

//   Important: Methods and properties of objects in VCL can only be
//   used in a method called using Synchronize, for example:
//
//      Synchronize(UpdateCaption);
//
//   where UpdateCaption could look like:
//
//      void __fastcall Unit1::UpdateCaption()
//      {
//        Form1->Caption = "Updated in a thread";
//      }
//---------------------------------------------------------------------------

__fastcall TLOOKUP_NAME::TLOOKUP_NAME(long int index,AnsiString ip,bool CreateSuspended)
        : TThread(CreateSuspended)
{
  tree_index=index;
  ip_str=ip;
  FreeOnTerminate = True;
}
//---------------------------------------------------------------------------
void __fastcall TLOOKUP_NAME::Execute()
{
  ip_str=gethostbyip(ip_str);
  Synchronize(set_str);
}

void __fastcall TLOOKUP_NAME::set_str()
{
  TTreeNode *temp_node;
  temp_node=main_f->Tree_port->Items->GetNode((HTREEITEM)tree_index);
  temp_node->Text=temp_node->Text+" : "+ ip_str;
}

⌨️ 快捷键说明

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