Пример #1
0
 public void Felica_GetPMm_Suica()
 {
     using (var felica = new Felica(FelicaSystemCode.Suica))
     {
         Debug.WriteLine(felica.GetPMm().ToHexString());
     }
 }
Пример #2
0
        static void ReadEdyBalanceEtc()
        {
            using (var felica = new Felica(FelicaSystemCode.Edy))
            {
                Console.WriteLine(felica.GetIDm().ToHexString());
                Console.WriteLine(felica.GetPMm().ToHexString());

                var data = felica.ReadWithoutEncryption(FelicaServiceCode.EdyBalance, 0);
                Console.WriteLine(new EdyBalanceItem(data).Balance);
            }
        }
Пример #3
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);
                    }
                }
            }
        }