|
I'd go for something that calls home and sends an activation code by email, for the application on a specific combination of hardware-id's.
Actually this is what I want. Can you please suggest how could I achieve this ? And if my CD gets copied how come I know that installation of this CD already been done.
Thanks .
pranitkothari@rediffmail.com
|
|
|
|
|
Member 3219104 wrote: Can you please suggest how could I achieve this ?
The MAC-address[^] is the serial number of the network-card. The motherboard[^] also has a serial number. The drive-volume[^] has a number that changes each time that the harddisk if formatted.
The idea would be that you application makes a hash from these numbers and then sends that to you. That would be an unique identifier for an installation, and it would have to match a registration. Once the number is in, you send back an activation-code to unlock the application.
You can't link the information to a particular CD - since it's simple to make an exact duplicate of that thing.
I are Troll
|
|
|
|
|
Really helpful.
Thank you.
|
|
|
|
|
You're welcome
I are Troll
|
|
|
|
|
|
Hi,
I am an experienced asp.net with 3 years of experience. I would like to use my C# knowledge in embedded softwares like car audio, audio/ visuals etc. I need some guidance in that. Can you please provide me with some sample projects or some tutorials??
Thanks & Regards,
ap.
|
|
|
|
|
Embedded systems have limited resources, and most of them don't run the .NET framework; most embedded software is developed using C, C++, and Java; not C#.
And it is a big leap from ASP.NET to embedded software, you'll probably need to know a lot about operating system internals, hardware, real-time aspects, etc.
AFAIK there aren't many articles about it here on CodeProject. Try Google, or go visit the web sites of vendors that are relevant to the applications you envision.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
'image_editor.Form1.ComplementImages(System.Drawing.Image)': not all code paths return a value'
Can someone tell me whats the error in this code................
|
|
|
|
|
like this :
public bool DoIt(int input)
{
if (input == 0)
{
return true
}
}
All possible paths should have a return value
|
|
|
|
|
djsproject wrote: error in this code
Sorry, but where is your code?
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
|
How many columns do you have in this table called Marks?
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
thank you for your reply
i got the answer after sometime.
thanks
|
|
|
|
|
Hi guyz.. Im still on my project as the final touch up i have a task to be added to my project.. As i have mentioned in my previous post my project is on console application.. Thank you 2 all in code project because from the help and advice that i got from everyone at code project i was able 2 completed 90% of my project.. now the issue in my project it that my project migrates all the records stored in xml to the database its fine with it, certain records in the xml file are stored in another file in xml my application catches the file exactly and inserts the records from it. now i have a verification coded in my application which checks whether that particular file is present in the folder, if the file is present the records from it are migrated if the file is not present, on the output window it displays the name of the file stating that the file is missing in the folder.. now since my application has nested for loops and if condition the verification for the same file takes place more than once so in the output window the same missing file name is printed more than one(may be 10times) it becomes messy 2 see the output window..
Now what i would try to implement is that even if it checks the same file for the second time and if the file is not present it should display the message on the output window only one.. my coding is as follows:
class Class1
{
XmlDataDocument doc1 = new XmlDataDocument();
doc1.Load(ConfigurationSettings.AppSettings["fun"]);
XmlNodeList nodes1 = doc1.GetElementsByTagName("Row");
foreach(XmlNode node1 in nodes1)
{
if(node1.HasChildNodes && node1.ChildNodes.Count > 0)
{
XmlElement Element1 = (XmlElement) node1;
string f_ID = Element1.GetElementsByTagName("Id")[0].InnerText;
string f_AppId = Element1.GetElementsByTagName("AppId")[0].InnerText;
string f_FileName = Element1.GetElementsByTagName("FileName")[0].InnerText;
if(f_AppId==app)
{
string path = ConfigurationSettings.AppSettings["funfile"]+"\\"+f_FileName+".xml";
if (File.Exists(path))
{
XmlDataDocument doc2 = new XmlDataDocument();
doc2.Load(ConfigurationSettings.AppSettings["funfile"]+"\\"+f_FileName+".xml");
XmlNodeList nodes2 = doc2.GetElementsByTagName("Function");
foreach(XmlNode node2 in nodes2)
{
if(node2.HasChildNodes && node2.ChildNodes.Count > 0)
{
XmlElement Element2 = (XmlElement) node2;
string ff_Id = Element2.GetElementsByTagName("Id")[0].InnerText;
string ff_Url = Element2.GetElementsByTagName("Url")[0].InnerText;
string ff_AppId = Element2.GetElementsByTagName("AppId")[0].InnerText;
string ff_Status = Element2.GetElementsByTagName("Status")[0].InnerText;
if(f_ID==ff_Id && f_AppId==ff_AppId)
{
if(ff_Status=="Active" || ff_Status=="A" || ff_Status=="P")
{
cmd = new OdbcCommand("insert into EACS_Function_1 values('"+ff_Id+"','"+ff_FunctionDescription+"','"+ff_Url+"','"+ff_AppId+"','"+ff_Type+"','"+ff_MenuCommand+"','A','','','')",con);
cmd.ExecuteNonQuery();
}
}
else
{
Console.WriteLine("Please check Function file-{0} fields do not match",f_FileName);
}
}
}
}
else
{
Console.WriteLine("Function file {0} not present",f_FileName);
}
}
}
}
This is only a part of my coding.. My application has 860 lines of code.. so just imagine that how long my coding will be.. so plz advice me, when the for loop is traversed again and again the same missing file name is displayed on the screen which i have to aviod.. plz guide me..
Thanx in advance..
Regards,
Tash
|
|
|
|
|
One simple approach could be to create a bool variable called isPrinted and set it to false before your looping begins. When you reach a statement that will print a message saying that the file doesn't exist - check if the isPrinted is true . If not, then print your message and set isPrinted = true . The next time you reach the print statement your message will not print.
I didn't read your code very thorough, but it seems to me that you might want to change your design if you run into these kind of problems. Take a minute to think about it. Good luck!
|
|
|
|
|
thanx for ur reply... but that boolean function wont work in my condition because i have more that 5000 files and about 300 files are missing.. Ur case wil work if i have only one file which is missing... i think u got my point...
Regards,
Tash
|
|
|
|
|
Hello,
You could hold your outputed filenames in a list and make a lookup in the list bevor you do the next output.
Like this (using a generic List):
List<string> fileNames = new List<string>();
string f_FileName = ...;
...
if (!fileNames.Contains(f_FileName))
{
fileNames.Add(f_FileName);
Console.WriteLine("Please check Function file-{0} fields do not match", f_FileName);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
thanx but genericlist can be used in Dotnet framework 2.0 but im using VS2003 on framework 1.0 .. can i make use of array.. but the problem is i am not very much strong in arrays.. Do please guide me...
Thanx in advance..
Regards,
Tash
|
|
|
|
|
Hello,
<<thashif>> wrote: thanx but genericlist can be used in Dotnet framework 2.0 but im using VS2003 on framework 1.0
that's true!
<<thashif>> wrote: can i make use of array.. but the problem is i am not very much strong in arrays.. Do please guide me.
Sure!
instead of generics, you could use the StringCollection class, which is available in .Net 1.x:
using System.Collections.Specialized;
...
StringCollection fileNames = new StringCollection();
StringCollection , does also provide a Contains and a Add method, like the generic list.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hurray!!! it worked.... Thank u.. Million thanx.. Now my application is fully finished one.. once again thank you buddy...
Regards,
Tash
|
|
|
|
|
<<thashif>> wrote: Hurray!!! it worked.... Thank u.. Million thanx.. Now my application is fully finished one.. once again thank you
Wow, I'm really glad I could help!
All the best,
Martin
|
|
|
|
|
Hello again!
Apart from the solution I provided, I would like you to know, that you should take care about the ressources used by the OdbcCommand instances.
<<thashif>> wrote: cmd = new OdbcCommand...
Here you are instanciating allways a new OdbcCommand in a nested loop, and do not care about the ressources.
The OdbcCommand[^] derives from System.ComponentModel.Component[^], which does not implement IDisposable but provides a Dispose[^] method, you should call (cmd.Dispose(); ).
All the best,
Martin
|
|
|
|
|
Thanx for ur reply... as i have already mentioned my application is too big to post the complete code over here....
Martin# wrote: you should call (cmd.Dispose();).
i have a finally block which is as follows:
finally
{
if (rdr != null)
{
rdr.Close();
}
if (con != null)
{
con.Close();
con.Dispose();
}
cmd.Dispose
}
Thanx for ur advice i really appreciate it...
Regards,
Tash
|
|
|
|
|
sorry sorry i thought u were speaking abt the connection obj... okay fine i will take up ur advice of using
cmd.Dispose();
Thanx alot..
Regards,
Tash
|
|
|
|
|
<<tash18>> wrote: okay fine i will take up ur advice of using
cmd.Dispose();
All the best,
Martin
|
|
|
|