![]() If (connection.ProfileName = ConnectionName) Var connectionProfiles = NetworkInformation.GetConnectionProfiles() įoreach (var connection in connectionProfiles) Private static ConnectionProfile GetConnectionProfile(string ConnectionName) StartTime = StartTime.Add(granularityTimeSpan) Upload = ConvertBytesToMB(networkUsage.BytesSent), Var connectionReport = new ConnectionReport()ĭate = (dateFormat),ĭownload = ConvertBytesToMB(networkUsage.BytesReceived), Var networkUsages = await connectionProfile.GetNetworkUsageAsync(StartTime, EndTime, Granularity, new NetworkUsageStates()) įoreach (var networkUsage in networkUsages) Var connectionProfile = GetConnectionProfile(ConnectionName) ![]() Var granularityTimeSpan = GranularityToTimeSpan(Granularity) ![]() I read document in MSDN and I write this code for my app: public async static Task> GetNetworkUsageAsync(string ConnectionName, DateTimeOffset StartTime, DateTimeOffset EndTime, DataUsageGranularity Granularity) I want to get network usage for each connection in the target system. I love programming for UWP and I start new program with C# and UWP. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |