Hi!!!!!
I have made a exe file of my C# project.....
can anyone tell me how can my application read the mac address of target{user} system.........Also how can It be valid only for 1 year i.e. how to add the code of subscription in my application that as user install my software then it should be valid for 1 yr only and no other person could install it on his system.......
Loading
Kirtan PatelPosted Aug 12, 2009, 8:52 AM
Here you can Simply Do it Without any Management Object Coding Simple to Understand Code :)
and you can also Locate MAC of Connected other pcs just Change that StartInfo.Argument Line according to your need
and you are done :)
private void button1_Click(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo.FileName = "getmac.exe";
p.StartInfo.Arguments = @"/s YourServer /u Domain\ComputerName /p YourPassword";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
p.WaitForExit(200);
// Extract MACS from output
Regex re = new Regex("([0-9a-fA-F][0-9a-fA-F]-){5}([0-9a-fA-F][0-9a-fA-F])");
MatchCollection mc = re.Matches(p.StandardOutput.ReadToEnd());
foreach (Match m in mc)
{
listBox1.Items.Add(m.ToString());
}
}
vinni jainPosted Aug 29, 2009, 1:54 AM
vinni jainPosted Aug 24, 2009, 7:53 AM
Kirtan PatelPosted Aug 24, 2009, 7:40 AM
as i know now you know that How to Write and Read in Registry :)
While you Install your Application Using "Setup Project" You will Create Two Registry Key One For Storing "Installation Date" and One For storing "Last Application Open Date"
Date Between Install Date And last opened Date in Registry then allow Further Access and Application Always Writes The Current Date to Last Opened Date key in Registry after verifying the Dates at Start up(On Load).
If somebody changes the system date then application will check if the application latest opened date and Difference of
if the system date is less than the last opened date then update you application installed date to 1/1/1900 this way they can't even open the application even if it backdated.
vinni jainPosted Aug 24, 2009, 3:01 AM
You haven't replied yet............
I am waiting for your reply.........
Kindly reply......
Kirtan PatelPosted Aug 12, 2009, 2:45 PM
so i don't thing it will work because we have to store data about installation date and current date some where
then at every run of application that application checks that application expired or not .
i m working on your code right now will post your code here when it is completed
vinni jainPosted Aug 12, 2009, 12:45 PM
Kirtan can u plz tell me that where should i add the code in my project which Roei Bar has given, such that when user installs my application,firstly it reads the system's mac address and subscribe for 1 yr.
vinni jainPosted Aug 12, 2009, 1:36 AM
Yaa give the code for finding the mac address of remote computer..........
also tell me since i have made teh exe file of my project , so tell me where and how should I add this code in my application...
Kirtan PatelPosted Aug 11, 2009, 4:53 PM
do you need mac of remote computer that is connected to your computer through lan ?
Roei BarPosted Aug 11, 2009, 4:12 PM
and for Time Limitation you can use this code, Change is as needed and use this class on applicationStart: