public void LaunchApplicationWithParameter(System.Security.Principal.WindowsIdentity user, string host, RedirectionApplication redirectApp, string fileUrl) { try { ApplicationItem appInfo = _service.GetApplicationInfo(redirectApp.InternalName, _service.GetUser(user), host, "", null, null, null, redirectApp.FarmName); if (!string.IsNullOrEmpty(appInfo.ContentAddress)) { String address = appInfo.ContentAddress; if (address != null) { this.Page.Response.Redirect(address); } } else { string app = _service.LaunchApplicationWithParameter(redirectApp.InternalName, fileUrl, _service.GetUser(user), host, "", redirectApp.FarmName); this.Page.Response.Clear(); this.Page.Response.ClearContent(); this.Page.Response.ClearHeaders(); this.Page.Response.ContentType = "application/x-ica"; this.Page.Response.AddHeader("Content-Type", "application/x-ica"); this.Page.Response.BinaryWrite(this.Page.Response.ContentEncoding.GetBytes(app)); this.Page.Response.End(); } } catch (ThreadAbortException) { //Do nothing } catch (Exception ex) { SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("Extentrix", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, ex.Message, ex.StackTrace); PageLogger.Error("An error occured during launch application", ex); } }