Windows Develop Bookmark and Share   
 index > Windows Forms General > Make trail time??
 

Make trail time??

hi i wonder how i can makemy program to a trial time application.

I thought it would be like this:

String dt = DateTime.Now.ToString("yyyy-MM-dd");

string timebomb = ("2007-10-28");

if(dt => timebomb)

{

Application.Exit();

}

but it´s wrong.

any suggestions??

André Dani  Sunday, October 28, 2007 6:22 PM

I'm not sure that this is 100% secure Wink, but hey...

Code Block

private void Form1_Load(object sender, EventArgs e)

{

int year = Convert.ToInt32(DateTime.Now.Year);

int day = Convert.ToInt32(DateTime.Now.Day);

int month = Convert.ToInt32(DateTime.Now.Month);

if(year >= 2007 && day >= 28 && month >= 10)

{

MessageBox.Show("Sorry, you are past the trial version deadline!");

Application.Exit();

}

}

Thanks,

paoloTheCool

paoloTheCool  Sunday, October 28, 2007 7:35 PM

I'm not sure that this is 100% secure Wink, but hey...

Code Block

private void Form1_Load(object sender, EventArgs e)

{

int year = Convert.ToInt32(DateTime.Now.Year);

int day = Convert.ToInt32(DateTime.Now.Day);

int month = Convert.ToInt32(DateTime.Now.Month);

if(year >= 2007 && day >= 28 && month >= 10)

{

MessageBox.Show("Sorry, you are past the trial version deadline!");

Application.Exit();

}

}

Thanks,

paoloTheCool

paoloTheCool  Sunday, October 28, 2007 7:35 PM

You can use google to search for other answers

Custom Search

More Threads

• Weird Treeview behavior when cleared
• Complex DataBinding accepts as a data source either an IList or an IListSource
• Problem with opening forms in VC++2005 Express
• Simple forms question...
• Error: Relationships between (1) and (2) are not supported
• multiline problem
• Form Controls?
• in datagrid when double clicked i want to open a new window to update that rows infos in my database
• Application hangs with a call to MessageBox.Show
• split contaier with fixed bottom panel - is it possible?