uniGUI运行期加载网站图标
procedure TuniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); begin if FileExists(Self.StartPath + 'favicon.ico') then Self.Favicon.LoadFromFile(Self.StartPath + 'favicon.ico'); end;
一定要在ServerModule.BeforeInit事件中实现,在OnCreate中是无效的。
下面是浏览器的截图,用上面的代码,正确显示了图标:

当然,也可以在设计期,静态的设置uniServerModule.Favicon属性,定义图标。我完全是因为多个项目共用一个uniServerModule,才需要运行期加载图标。
浙公网安备 33010602011771号