Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
CnPack IDE 专家包(CnWizards)
» “INI读写单元生成向导”在D2009生成乱码问题
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: “INI读写单元生成向导”在D2009生成乱码问题
wfymqj
灌水科科长
UID 1023
Digest Posts 0
Credits 178
Posts 70
点点分 178
Reading Access 10
Registered 2005-9-6
Location 湖北
Status Offline
#1
Post at 2009-2-8 09:36
Profile
|
Blog
|
P.M.
“INI读写单元生成向导”在D2009生成乱码问题
“INI读写单元生成向导”在D2009生成乱码问题
1.Delphi2009中,使用“INI读写单元生成向导”,若原INI文件中有中文的话,生成的文件中会在单元文件末出现乱码(版本0.9.0.479)(D2009版本 V12.0.3210.17555)
2.使用“INI读写单元生成向导”生成的单元文件的LoadFromFile方法中,将“if FileExists(FileName) then”去掉是否会更好。加入此句的话,若FileName不存在,则无法载入默认值了。
Image Attachment
: [在D2009生成乱码图]
乱码图.JPG
(2009-2-8 09:36, 24.61 K)
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#2
Post at 2009-2-9 16:46
Profile
|
Blog
|
P.M.
我用最新的0.9.0.481,拿了个简单的带中文的ini文件测试了一下,暂没楼主提到的问题。能否发个示例的ini文件上来供测测?
wfymqj
灌水科科长
UID 1023
Digest Posts 0
Credits 178
Posts 70
点点分 178
Reading Access 10
Registered 2005-9-6
Location 湖北
Status Offline
#3
Post at 2009-2-10 12:50
Profile
|
Blog
|
P.M.
用最新的0.9.0.481测试确实无此问题
不知对于第2点你们如何认为
softbug
新警察
UID 1787
Digest Posts 0
Credits 20
Posts 8
点点分 20
Reading Access 10
Registered 2006-2-9
Status Offline
#4
Post at 2009-2-12 21:38
Profile
|
Blog
|
P.M.
不带示例代码不做分析!
wfymqj
灌水科科长
UID 1023
Digest Posts 0
Credits 178
Posts 70
点点分 178
Reading Access 10
Registered 2005-9-6
Location 湖北
Status Offline
#5
Post at 2009-2-13 15:00
Profile
|
Blog
|
P.M.
这里对应我的第2个问题
procedure TIniOptions.LoadSettings(Ini: TIniFile);
begin
if Ini <> nil then
begin
{Section: 接收发送延时}
FInceptDelay := Ini.ReadString(csIniJSFSYSSection, csIniInceptDelay, '300');
end;
end;
procedure TIniOptions.LoadFromFile(const FileName: string);
var
Ini: TIniFile;
begin
// if FileExists(FileName) then //注释掉此句,在不存在FileName时程序才能调用到默认值,否则根本不调用LoadSettings
begin
Ini := TIniFile.Create(FileName);
try
LoadSettings(Ini);
finally
Ini.Free;
end;
end;
end;
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#6
Post at 2009-2-13 23:47
Profile
|
Blog
|
P.M.
用户自己倒是可以在Data\Template下面手工改掉模板文件。
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-23 10:36
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.011263 second(s), 10 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats