Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Development
  4. Unable to obtain Bytes sent and received using MB APIs on Win8

Unable to obtain Bytes sent and received using MB APIs on Win8

Scheduled Pinned Locked Moved Windows Development
csharp
2 Posts 1 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sharath C V
    wrote on last edited by
    #1

    I am not able to get bytes sent and received using NetworkInformation.GetInternetConnectionProfile(); since this function is returning Null. Mobile Broadband dongle is being used to connect to internet. Connection calls using MB APIs are successful. Code that fails is shown in the snippet below:

    using Windows.Networking.Connectivity;
    .
    .
    .
    .
    ConnectionProfile connectionprofile = NetworkInformation.GetInternetConnectionProfile();
    if (connectionprofile != null)
    {
    DataUsage localusage = connectionprofile.GetLocalUsage(startime, currtime);
    string message = "\n Connection details: bytes received:" + localusage.BytesReceived + " bytes sent:" + localusage.BytesSent + "\n";
    }

    -Sharath

    S 1 Reply Last reply
    0
    • S Sharath C V

      I am not able to get bytes sent and received using NetworkInformation.GetInternetConnectionProfile(); since this function is returning Null. Mobile Broadband dongle is being used to connect to internet. Connection calls using MB APIs are successful. Code that fails is shown in the snippet below:

      using Windows.Networking.Connectivity;
      .
      .
      .
      .
      ConnectionProfile connectionprofile = NetworkInformation.GetInternetConnectionProfile();
      if (connectionprofile != null)
      {
      DataUsage localusage = connectionprofile.GetLocalUsage(startime, currtime);
      string message = "\n Connection details: bytes received:" + localusage.BytesReceived + " bytes sent:" + localusage.BytesSent + "\n";
      }

      -Sharath

      S Offline
      S Offline
      Sharath C V
      wrote on last edited by
      #2

      Setting this solved the issue: internetClient capability in app manifest.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups