0
我想,当你关闭应用程序Silverlight的退出调用Web服务
public App()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;
InitializeComponent();
}
private void Application_Exit(object sender, EventArgs e)
{
ClientReverse.UserExitGameAsync((Guid)Login);
}
服务器将数据发送到服务器:
public void UserExitGame(Guid UserGuid)
{
Games.Games.ExitUserGames(UserGuid);
}
但服务器端并不满意。
因为silverlight正在调用WCF,为什么不直接调用HTML中的onbeforunload并使用ajax调用WCF而不是silverlight? – Rumplin
@Rumplin:这也是有效的,但我看到很多关于'onbeforeunload'的故事不适用于所有浏览器。歌剧显然不会解雇它。 –
好吧,不知道,因为我主要在IE和Silverlight的封闭环境(Intranet)中工作。谢谢你的提示。 – Rumplin