Skip to content

Instantly share code, notes, and snippets.

public async void GetConnections()
{
var hostnames = new List<HostName>();
foreach (var hn in NetworkInformation.GetHostNames())
{
if (hn.IPInformation != null && hn.IPInformation.NetworkAdapter != null)
{
hostnames.Add(hn);
}
}
public void GetConnection()
{
var cp = NetworkInformation.GetInternetConnectionProfile();
Debug.WriteLine("Profile Name : " + cp.ProfileName);
// 接続状況
var cl = cp.GetNetworkConnectivityLevel();
Debug.WriteLine("Connectivity Level: " + cl);
}
public static void PopulateAdapterList()
{
foreach (Windows.Networking.HostName localHostInfo
in Windows.Networking.Connectivity.NetworkInformation.GetHostNames())
{
if (localHostInfo.IPInformation != null)
{
Debug.WriteLine("Host Name : " + localHostInfo);
Debug.WriteLine("Interface Type : " + localHostInfo.IPInformation.NetworkAdapter.IanaInterfaceType);
@kazuakix
kazuakix / AppSettingSample.cs
Created July 13, 2014 08:54
Windows Phone 8.1 samples - Contact Bindings Sample より
using System;
using System.IO.IsolatedStorage;
using System.Diagnostics;
namespace Shared_Library
{
public class AppSettings
{
// Our isolated storage settings
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
namespace Net.Tauchi.Sue
{
public class AppSettings
using System;
using System.Collections.Generic;
using System.IO.IsolatedStorage;
namespace Net.Tauchi.Sue
{
/// <summary>
/// アプリの設定
/// </summary>
public class AppSettings
// System.Net.Http.HttpClient でテスト
private async void OnTest1ButtonClicked(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("========== System.Net.Http.HttpClient test start ==========");
var sw = new System.Diagnostics.Stopwatch();
sw.Start();
await GetImage1("http://flashair/DCIM/101NIKON/DSCN0558.JPG", "DSCN0558.JPG");
sw.Stop();