code is using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using RfidApiLib; using System.IO; using System.Data.SqlClient; using System.Threading; namespace Service_Ambu_Exit { public partial class Form1 : Form { RfidApi api = new RfidApi(); public int TagCnt = 0; string ip; string portNo; string p_type = ""; string p1 = ""; string arr1; int intcount = 0; public Form1() { InitializeComponent(); } private int connectReader() { try { StreamReader sr1 = new StreamReader("ipandport.txt"); string[] str2; string[] str3; string arr3; arr3 = sr1.ReadLine(); str2 = arr3.Split('='); ip = str2[1].Trim(); StreamReader sr3 = new StreamReader("ipandport.txt"); string arr2; arr2 = sr3.ReadLine(); arr2 = sr3.ReadLine(); str3 = arr2.Split('='); portNo = str3[1].Trim(); int status; int port; string s = ""; try { port = int.Parse(portNo); s = ip; } catch (Exception) { logfile("Please mention the valid ip address and port in settings file."); return 0; } status = api.TcpConnectReader(ip, port); if (status != 0) { logfile("Connect Reader Failed."); return 0; } if (ip == "172.16.100.3".Trim() || ip == "172.16.100.4".Trim()) { p1 = "STAFF".Trim(); } else if (ip == "172.16.100.5".Trim() || ip == "172.16.100.7".Trim() || ip == "172.16.100.6".Trim()) { p1 = "AMBULANCE".Trim(); } else if (ip == "172.16.100.2".Trim() || ip == "172.16.100.1".Trim()) { p1 = "BASEMENT".Trim(); } StreamReader sr = new StreamReader("RFSettings.txt"
S
spider_vikas
@spider_vikas