public static CSLibrary.Structures.Version GetDemoVersion() { System.Version sver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; CSLibrary.Structures.Version ver = new CSLibrary.Structures.Version(); ver.major = (uint)sver.Major; ver.minor = (uint)sver.Minor; ver.patch = (uint)sver.Build; return ver; }
private void MenuForm_Load(object sender, EventArgs e) { labelInterface.Text = "Interface : " + Program.ReaderXP.CurrentInterfaceType.ToString(); label_ConfigFilePath.Text = "Config File Path : " + Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\CSLReader"; if (Program.ReaderXP.CurrentInterfaceType == CSLibrary.HighLevelInterface.INTERFACETYPE.IPV4) { button7.Enabled = true; button9.Enabled = true; } else { button7.Enabled = false; button9.Enabled = false; } try { //Show MAC and IP Text = String.Format("IP = {0}, MAC = {1}", Program.IP, Program.SerialNumber); labelDeviceType.Text = Program.ReaderXP.OEMDeviceType.ToString(); //Get RFID Library Version CSLibrary.Structures.Version rfidVers = Program.ReaderXP.GetDriverVersion(); //Get Firmware Version CSLibrary.Structures.Version FirmVers = Program.ReaderXP.GetFirmwareVersion(); //Get CSLibrary Version CSLibrary.Structures.Version cslib = Program.ReaderXP.GetCSLibraryVersion(); #if NET_BUILD //Get 8051 Ethernet Application Version CSLibrary.Structures.Version c51app = Program.ReaderXP.GetC51AppVersion(); if (c51app.major == 0) { c51app = Program.ReaderXP.GetImageVersion(); } //Get 8051 Ethernet Bootloader Version CSLibrary.Structures.Version c51bldr = Program.ReaderXP.GetC51BootLoaderVersion(); if (c51bldr.major == 0) { c51bldr = Program.ReaderXP.GetBootLoaderVersion(); } #endif //Get User Interface Version lb_software.Text = Program.GetDemoVersion().ToString();; //lb_rfidlib.Text = rfidVers.ToString(); // Not support in CSLibrary 3.0 lb_firmware.Text = FirmVers.ToString(); if (FirmVers.major == 1 && FirmVers.minor == 0) { label_BootloaderMode.Visible = true; } #if NET_BUILD lb_c51App.Text = c51app.ToString(); lb_c51bldr.Text = c51bldr.ToString(); #endif lb_cslib.Text = cslib.ToString(); CSLibrary.Constants.ApiMode Mode; if (Program.ReaderXP.GetApiMode(out Mode) == CSLibrary.Constants.Result.OK) { labelApiMode.Text = "API Mode : " + Mode.ToString(); } else { labelApiMode.Text = "API Mode : Read Error"; } //No use //Program.Power.Show(); //Refresh Reader Configuration, e.g. frequency channel, power, country UpdateSetting(); CSLibrary.Windows.UI.SplashScreen.Stop(); } catch (Exception ex) { MessageBox.Show(String.Format("Reader Startup fail : {0}", ex)); this.Close(); } }