線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2725
推到 Plurk!
推到 Facebook!

idFtp 由Xe2轉在Xe7 編碼問題iohandler.defStringEncoding

答題得分者是:aftcast
weiliching
初階會員


發表:53
回覆:78
積分:31
註冊:2003-12-27

發送簡訊給我
#1 引用回覆 回覆 發表時間:2015-06-15 15:05:25 IP:211.23.xxx.xxx 訂閱
使用 idFtp 

之前在Xe2 compile 是沒問題的,我現在電腦更新到 Xe7 ,

發現會出現

[dcc32 Error] M_Score.pas(105): E2010 Incompatible types: 'IIdTextEncoding' and 'TEncoding' 錯誤

我查了 help .defStringEncoding 這內容 需要給他TIdTextEncoding 類別的東西,

對照了Xe2 原本的Help ..因該也是同樣的TIdTextEncoding

看來解說是都正常的,

這會是我版本的問題嗎?



原程式碼如下:

IdFtp1.Connect;

IdFtp1.ChangeDir(M_TxtDir);

IDftp1.iohandler.defStringEncoding := Tencoding.Ansi; <-- 此行出錯

ProgressBar1.Max:= idFtp1.Size(M_TxtFile);

idFtp1.Get(M_TxtFile,M_Path,true);

IdFtp1.Disconnect;
編輯記錄
weiliching 重新編輯於 2015-06-15 16:05:36, 註解 無‧
aftcast
站務副站長


發表:81
回覆:1485
積分:1763
註冊:2002-11-21

發送簡訊給我
#2 引用回覆 回覆 發表時間:2015-06-15 19:05:02 IP:114.32.xxx.xxx 訂閱
IndyTextEncoding(Tencoding.Ansi)
IndyTextEncoding(950)

IndyTextEncoding_OSDefault

===================引 用 weiliching 文 章===================

IDftp1.iohandler.defStringEncoding := Tencoding.Ansi; <-- 此行出錯
------


蕭沖
--All ideas are worthless unless implemented--

C++ Builder Delphi Taiwan G+ 社群
http://bit.ly/cbtaiwan
編輯記錄
aftcast 重新編輯於 2015-06-15 19:08:34, 註解 無‧
aftcast 重新編輯於 2015-06-15 19:17:25, 註解 無‧
aftcast 重新編輯於 2015-06-15 19:19:38, 註解 無‧
weiliching
初階會員


發表:53
回覆:78
積分:31
註冊:2003-12-27

發送簡訊給我
#3 引用回覆 回覆 發表時間:2015-06-16 08:51:41 IP:211.23.xxx.xxx 訂閱


剛剛改了,發現未定義 indyTextEncoding 函數,

[dcc32 Error] M_Score.pas(105): E2003 Undeclared identifier: 'IndyTextEncoding

不知道是不是少use 了某東西



查了技術文件

For instance, the IdGlobal.TIdTextEncoding class has been replaced with a new IdGlobal.IIdTextEncoding refcounted interface that no longer depends on SysUtils.TEncoding (Embarcadero) or System.Text.Encoding (.NET) anymore (though there are wrappers provided if you still need to use them with Indy). Consequently, the IndyXXXEncoding() functions have been deprecated in favor of new IndyTextEncoding_XXX() functions.



但是改了函數也不行~因該是少Use 了某東西
這篇內容好像也是跟我發生同樣的問題
http://codeverge.com/embarcadero.delphi.winsock/indy-iidtextencoding-issue/1074884



編輯記錄
weiliching 重新編輯於 2015-06-16 10:02:37, 註解 無‧
aftcast
站務副站長


發表:81
回覆:1485
積分:1763
註冊:2002-11-21

發送簡訊給我
#4 引用回覆 回覆 發表時間:2015-06-16 13:16:18 IP:114.32.xxx.xxx 訂閱
uses IdGlobal;
===================引 用 weiliching 文 章===================


查了技術文件

IdGlobal.TIdTextEncoding class has been replaced with a new IdGlobal.IIdTextEncoding refcounted interface that no longer depends on SysUtils.TEncoding (Embarcadero) or System.Text.Encoding (.NET) anymore (though there are wrappers provided if you still need to use them with Indy). Consequently, the IndyXXXEncoding() functions have been deprecated in favor of new IndyTextEncoding_XXX() functions.
------


蕭沖
--All ideas are worthless unless implemented--

C++ Builder Delphi Taiwan G+ 社群
http://bit.ly/cbtaiwan
系統時間:2024-04-26 1:56:54
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!