GetSerialNumber() public method

Gets the serial number of the current device.
public GetSerialNumber ( string &SerialNumber ) : FT_STATUS
SerialNumber string The serial number of the current device.
return FT_STATUS
        /// <summary>
        /// Called when the window is loaded
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WindowLoaded(object sender, RoutedEventArgs e)
        {
            int i;
            
            // Configure datagrid
            dataGrid1.Items.Clear();
            dataGrid1.Columns.Clear();
            dataGrid1.Columns.Add(new DataGridTextColumn { Header = "Device Number", Binding = new Binding("Dn") });
            dataGrid1.Columns.Add(new DataGridTextColumn { Header = "Serial Number", Binding = new Binding("Sn") });
            dataGrid1.Columns.Add(new DataGridTextColumn { Header = "Device Description", Binding = new Binding("Dd") });

            // Get FTDI basic data
            FTDI f = new FTDI();
            uint devicecount = 0;
            f.GetNumberOfDevices(ref devicecount);

            // Fill datagrid with device data
            string dd, sn, dn;
            if (devicecount == 0)
            {
                FtErrorReport("GetFTDeviceCount", FTDI.FT_STATUS.FT_DEVICE_NOT_FOUND);
            }
            for (i = 0; i < devicecount; i++)
            {
                f.OpenByIndex((uint)i);
                dn = String.Format("Device {0}", i);
                f.GetSerialNumber(out sn);
                f.GetDescription(out dd);
                f.Close();
                dataGrid1.Items.Add( new SDevice{ Dd = dd, Dn = dn, Sn = sn } );
            }
        }