//#include "IdIPWatch.hpp"(添加頭文件) //求出本機器的IP地址... AnsiString ls_CurrentIP ; TIdIPWatch * IdIPWatch1=new TIdIPWatch(this); ls_CurrentIP= IdIPWatch1->LocalIP(); ShowMessage(ls_CurrentIP); delete IdIPWatch1;
運行程序時沒問題,當關閉程序後便產生了iphist.dat文件,這是由於使用了IdIPWatch,並未去修改它的相關參數所致,自然它的默認設置會自動產生一個iphist.dat,將 HistoryEnabled 設置爲 False ,重新編譯即可解決該問題。