I've created an application that is pretty widely used and would like to get an idea of just how many people use it and how often.
How can I implement something that will do that?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dorababu MekaPosted Jan 13, 2013, 3:03 AM
http://msdn.microsoft.com/en-us/library/system.net.iphostentry.addresslist%28VS.80%29.aspx
http://stackoverflow.com/questions/1059526/get-ipv4-addresses-from-dns-gethostentry
Matthew DespainPosted Jan 12, 2013, 10:49 PM
Neha SharmaPosted Jan 12, 2013, 4:37 AM
You can make your database live and can install setup (given by dora sir) it ll work .
Thanks.
Dorababu MekaPosted Jan 12, 2013, 2:10 AM
Form_Load()
{
get the Ip if needed and check for the IP already exists in db or not
if not exists make a count variable to 1 and to 2,3 and so on when ever user open the solution
}
private void frmIP_Load(object sender, EventArgs e)
{
string machineName = Environment.MachineName;
string ipAddress = Dns.GetHostAddresses(Environment.MachineName)[0].ToString();
int icnt = 0;
MySqlConnection con = new MySqlConnection("server=172.16.18.31;database=efdb;uid=root;pwd=server@123");
MySqlCommand cmd = new MySqlCommand("select count from tblIpInfo where machineName='" + machineName + "'", con);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
MySqlDataAdapter da = new MySqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
if (Convert.ToInt16(ds.Tables[0].Rows[0]["count"]) != 0)
{
icnt = Convert.ToInt16(ds.Tables[0].Rows[0]["count"]);
icnt++;
cmd.Parameters.Clear();
cmd = new MySqlCommand("update tblIpInfo set count='" + icnt + "' where ipAddress='" + ipAddress + "'", con);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd.ExecuteNonQuery();
}
}
else
{
icnt++;
cmd.Parameters.Clear();
cmd = new MySqlCommand("insert into tblIpInfo values('" + ipAddress + "','" + machineName + "','" + icnt + "')", con);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd.ExecuteNonQuery();
}
}