Exemplo n.º 1
0
 public void Felica_TryConnectionToCard()
 {
     using (var felica = new Felica(FelicaSystemCode.Any))
     {
         Assert.AreEqual(false, felica.TryConnectionToCard());
     }
 }
Exemplo n.º 2
0
        static void Test1()
        {
            for (int i = 0; i < 1000; i++)
            {
                Console.WriteLine("Start");

                using (var felica = new Felica(FelicaSystemCode.Edy))
                {
                    Console.WriteLine("FeliCa ポート: {0}", felica.TryConnectionToPort());
                    Console.WriteLine("IC カード: {0}", felica.TryConnectionToCard());

                    try
                    {
                        Console.WriteLine(felica.GetIDm().ToHexString());
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                    try
                    {
                        Console.WriteLine(felica.GetPMm().ToHexString());
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                    try
                    {
                        var data = felica.ReadWithoutEncryption(FelicaServiceCode.EdyBalance, 0);
                        Console.WriteLine(new EdyBalanceItem(data).Balance);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
            }
        }