문제

If someone launches my xbap from http://myserver/folder/application.xbap, I would like to get the http://myserver/folder/ part of the url from within the application.

How can I do that?

I have tried:

  • System.IO.Directory.GetCurrentDirectory()
  • System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName)
  • Environment.CurrentDirectory
  • System.Reflection.Assembly.GetExecutingAssembly().Location
  • AppDomain.CurrentDomain.BaseDirectory
  • System.Windows.Application.Current.StartupUri.AbsolutePath
  • System.Environment.GetCommandLineArgs()[0]
  • System.Deployment.Application.ApplicationDeployment.CurrentDeployment.DataDirectory

They all return either the local location on my machine that the xbap got downloaded to and is running from, or the location of the executing assembly, such as C:\Windows\SysWOW64

How can I access the URL that was used to launch an xbap application from within the application itself?

도움이 되었습니까?

해결책

I believe it was BrowserInteropHelper.Source:

Gets the uniform resource identifier (URI) for the location from which a XAML browser application (XBAP) application was launched.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top