[UWP] 在Windows Phone 10 or Win10 中透過 UDP 接收資料

2015-09-02

這寫法在目前Window 10 IoT 10.0.10240.16384 上面測試過是正常的,然後再Window Phone 10 目前上面測試也是正常的
目前範例 按下按鈕後,會打開Port 1947 ,透過UDP接收資訊,收到後會用Dialog 跳出來..

wp_ss_20150902_0008


[UWP] Windows.Storage StorageFolder & FileIO 寫入文字讀取文字

2015-09-01


最近在看 Universal Windows Platform 的東西,之前都是用isolated storage ,但是最近看到官方文件寫到



Isolated storage is not available for Windows Store apps. Instead, use the application data classes in the Windows.Storagenamespaces included in the Windows Runtime API to store local data and files. For more information, see Application data in the Windows Dev Center.



所以就乾脆改變紀錄的方法,其實,透過Windows.Storage他存放的位置跟之前Isolated Storage 位置差不多 基本上只是多一層,目前我測試位置是



C:\Users\[USERNAME]\AppData\Local\Packages\[APPID]\LocalState\


[Winform] 筆記一下,C#透過UDP 接收資料

2015-08-31

上一篇文章 [Winform] 筆記一下,C#透過UDP 傳送資料 傳送了資料,那如何接受透過UDP接受資料呢?
一樣這一篇是屬於C# Winform or Console 透過  System.Net 的做法,新的UWP 是不能用的,不過當你需要測試時候就很好用,範例是,一直不斷Port 1947 的所有訊息,並且Text Encoding  是 UTF8
首先先撰寫接收的程式,因為是一值不斷地在聽牌,所以是要寫while(true) 的作法


/// <summary>
  /// UDP Client
  /// </summary>
  UdpClient udpClient = new UdpClient(1947);
 
  /// <summary>
  /// UDP 一直接收Port 1947 的資料,收到後跳Messagebox
  /// </summary>
  private void ThreadRunMethod()
  {
 
      while (true)
      {
          var remoteIp = new IPEndPoint(IPAddress.Any, 0);
 
          var receivedBytes = udpClient.Receive(ref remoteIp);
 
          if (receivedBytes == null || receivedBytes.Length == 0)
              return;
          string strReceiveStr = Encoding.UTF8.GetString(receivedBytes);
          MessageBox.Show("收到資料囉: " + strReceiveStr);
      }
  }


[Winform] 筆記一下,C#透過UDP 傳送資料


先說好,這是 C# Winform or Console 透過  System.Net 的做法,新的UWP 是不能用的,但是因為最近在測試Windows 10 IoT 的東西,所以我得在電腦端這邊寫測試程式紀錄一下

1.首先,要先using


using System.Net;
using System.Net.Sockets;
using System.Text;

2.這邊範例是 傳給 IP 為 192.168.6.100 , Port : 1947 , 中文字 許當麻 , Encoding : UTF8


var socket = new Socket(AddressFamily.InterNetwork,
    SocketType.Dgram,ProtocolType.Udp);
 
var serverAddr = IPAddress.Parse("192.168.6.100");
 
var endPoint = new IPEndPoint(serverAddr, 1947);
 
string text = "許當麻";
byte[] sendByte = Encoding.UTF8.GetBytes(text);
 
socket.SendTo(sendByte, endPoint);


[IoT] Windows 10 IoT on Raspberry Pi Wifi 問題小記錄

2015-08-28


現在有線網路越來越少,結果網路上看文件http://ms-iot.github.io/content/en-US/win10/SetupWiFi.htm
結果我眼殘沒有看到原來TP-LINK WN725N 是支援 MinnowBoard Max
Image 103


[Xamarin] Xamarin Form 初體驗

2015-08-27

最近在看一下Xamarin 官方的文件看到一個應該不算新發表,但是很有趣的東西 就是Xamarin Form
Image 096


當麻許的超技八 2014 | Donma Hsu Design.