System
This section covers APIs related to system-level operations and management within the Universal Windows Platform.
Windows.System Namespace
Provides classes for accessing system-level features, such as user identity, device information, and background tasks.
Windows.System.User
Represents a user account on the device.
// Get the current user
var currentUser = Windows.System.User.getDefault();
System.Diagnostics.Debug.WriteLine($"User Display Name: {currentUser.displayName}");
Windows.System.UserProfile
Provides access to user profile information and settings.
// Get the user's name
var userName = Windows.System.UserProfile.GlobalizationPreferences.userGeographicRegion;
System.Diagnostics.Debug.WriteLine($"User Region: {userName}");
Windows.System.Diagnostics.ProcessDiagnosticInfo
Provides information about running processes on the device.
// Get information about all running processes
var processes = await Windows.System.Diagnostics.ProcessDiagnosticInfo.getForManyProcessesAsync();
foreach (var process in processes)
{
System.Diagnostics.Debug.WriteLine($"Process Name: {process.processName}, ID: {process.processId}");
}
Windows.System.Threading Namespace
Provides classes for managing threads and asynchronous operations.
Windows.System.Threading.ThreadPool
Manages a pool of threads for executing work items asynchronously.
// Schedule a work item on the thread pool
Windows.System.Threading.ThreadPool.runAsync(() =>
{
System.Diagnostics.Debug.WriteLine("Background task executed.");
});