Inno 设置 TInputDirWizardPage 不允许 UNC 路径
我有一个 TInputDirWizardPage 允许用户选择备份目录。它会自动允许并对输入的路径(包括 UNC 路径)进行错误检查。备份目录不能是 UNC 路径。如何使其不允许并错误检查 UNC 路径?
procedure InitializeWizard();
begin
BackupInfoPage := CreateInputDirPage(100, 'caption', 'desc', 'sub caption', False,'Backup');
BackupInfoPage.Add('Backup Location:');
with BackupInfoPage do
begin
OnNextButtonClick := @BackupInfoForm_NextButtonClick;
end;
end;
function BackupInfoForm_NextButtonClick(Page: TWizardPage): Boolean;
begin
if not DirExists(BackupInfoPage.Values[0]) then
begin
ForceDirectories(BackupInfoPage.Values[0]);
end;
end;
I have a TInputDirWizardPage to allow the user to pick a backup directory. It automatically allows and error checks the entered paths including UNC paths. The backup directory cannot be a UNC path. How can I make it not allow and error check UNC paths?
procedure InitializeWizard();
begin
BackupInfoPage := CreateInputDirPage(100, 'caption', 'desc', 'sub caption', False,'Backup');
BackupInfoPage.Add('Backup Location:');
with BackupInfoPage do
begin
OnNextButtonClick := @BackupInfoForm_NextButtonClick;
end;
end;
function BackupInfoForm_NextButtonClick(Page: TWizardPage): Boolean;
begin
if not DirExists(BackupInfoPage.Values[0]) then
begin
ForceDirectories(BackupInfoPage.Values[0]);
end;
end;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我这样做了,但似乎没有做任何事情。
因此,我添加了对 NextButtonClick 的检查,以将它们保留在输入路径页面上,直到它们输入有效的非 unc 路径。
I did this, but it didn't seem to do anything.
So I added a check on the NextButtonClick to keep them on the enter path page until they enter a valid, non-unc path.