asp.net core - How to check programmatically is application been exeuted via Browser or executed as native application in &q

admin2025-03-19  5

From the .NET 9, the .NET MAUI Blazor Hybrid and Web App"-type project is available.

It has the shared code for both Web and native platform. But how to check programmatically is application been run via Browser as web app, or is being executed as native application? It should be something like:

// WARINING: It is NOT the actual API
if (Runtime.IsWeb()) {
  System.Diagnostics.Debug.WriteLine("Running via web. The files management is not available");
}


if (Runtime.IsNative()) {
  System.Diagnostics.Debug.WriteLine("Running as native app. The files management is available");
}
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1742388313a211109.html

最新回复(0)