|
You can simulate the trial key by reading and writing registry. Firstly, set a value in registry, when loading the application, read the registry and check if the user has the valid value which matches up the value already saved in the registry.
For some basic knowledge about registry, you can refer to this blog post.
http://devhood.com/tutorials/tutorial_details.aspx?tutorial_id=264
You'd probably be best to look at a commercial setup creator for that sort of functionality
Here's a list of commercial installers. Pretty pricey for the most part.
http://www.csharp411.com/net-installers/
|
|
|
|
|
Use the search box at the top of this forum to search the Code Project Articles for product key, there are several quite good articles on the subject.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Henry Minute wrote: Use the search box ... for product key
Lost your key again?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Have you seen my slippers?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
If you just heard the sound of breaking glass, you probably have stepped on your spectacles, and put your slippers on the top of your head.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
That's a hell of a visual, Luc, and brings to mind visions of my 80 yo mother... She's sharp as a tack, but she has her entertaining moments.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
I'm not sure why, but knowing Henry for some time now, he often reminds me of professor Zonnebloem[^]. I've enjoyed reading all his adventures.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
How perceptive of you Luc.
Visually quite accurate, except for the hair colour where I am more Snowy than Calculus!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
OK, I'll have to correct that image then.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi All
I did a function for doing a screenshot of the WinForm application I am doing now.
This function is run when the user click on a item of the main menu of the form ( MenuStrip ).
The point is that in doing this way the screenshot foo is called with the menu still open so the image includes also the open menu;
because of this I need to call the function right after the menu item gets close.
Do you know what could be the event?
I tried Drop DropDownClosed but it doesn't work.
Do you know what event fit my issue?
Thank you very much.
Regards
Mn
|
|
|
|
|
AFAIK there is no such event. What happens if you wait 50 msec before taking the snapshot?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thanks!
Simple solution that works nice.
It is true..i was not able to find such event
AFG
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Have you tried using the DropDownClosed event for the parent of the menu item in question? I'd probably set a flag in the item's Click event, then check it in the parent's DropDownClosed event and do your screen capture after the drop down menu has closed.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Yes and it doesn't work. I solved doing the screenshot 50 ms after the click.
|
|
|
|
|
I'm a little confused.
You say
manustone wrote: The point is that in doing this way ... the image includes also the open menu;
Then you say
manustone wrote: I need to call the function right after the menu item gets close
If you take the screenshot right after the menu is closed, how will the screenshot have the menu opened? Which do you want? Do you want the screenshot with the menu open or without the menu?
If you want to include the menu in the screenshot, I would create the image during the MouseDown and then save it during the Item_Click like so:
private Bitmap bmpScreenShot;
private Graphics gfxScreenShot;
private void takeScreenshotToolStripMenuItem_Click(object sender, EventArgs e)
{
bmpScreenShot.Save(@"D:\temp\screenshot.png", System.Drawing.Imaging.ImageFormat.Png);
}
private void takeScreenshotToolStripMenuItem_MouseDown(object sender, MouseEventArgs e)
{
bmpScreenShot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height,
System.Drawing.Imaging.PixelFormat.Format32bppArgb);
gfxScreenShot = Graphics.FromImage(bmpScreenShot);
gfxScreenShot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0,
Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
}
If, however, you're trying to do something after the menu is closed, you could handle its parents DropDownClosed event.
|
|
|
|
|
So, the screenshot captures the drop down and you want to find a way to get the screenshot without the dropdown? But you want it to be taken right after an item in the drop down is captured?
Perhaps you could try doing a Refresh() on the form to force it to redraw itself and then perform the screen capture. You might also initiate an asyncronous event via this.BeginInvoke and have that event take the screen capture.
|
|
|
|
|
how can i bind checklistbox control with object in memory in asp.net
|
|
|
|
|
Well, in one sense all objects used for DataBinding are in memory. So for anyone to be able to give a meaningful answer I think you are going to have to give a better description of what you are trying to do.
If possible, include a small snippet of the code you have and a description of any errors etc.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
what is the object you are referring to. Is it a dataset?
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
Hi,
I have the following complex type,
public class record()
{
string name1;
string name2;
}
I create a list of records in another function
public list<record> records();//list of records
Now I have to sort this class first by name1 and then by name2. Is there any simple way to do this?
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
Write a comparer that does what you want and use Sort?
|
|
|
|
|
using System.Linq;
public class record
{
public string name1;
public string name2;
}
List<record> records = new List<record>();
records.Add(new record() { name1 = "a", name2 = "b" });
records.Add(new record() { name1 = "c", name2 = "d" });
records.Add(new record() { name1 = "e", name2 = "f" });
records.Add(new record() { name1 = "g", name2 = "h" });
records.Add(new record() { name1 = "i", name2 = "j" });
var r = records.OrderByDescending(sort => sort.name1).OrderBy(sort2 => sort2.name2);;
|
|
|
|
|
rvdenden wrote: var r = records.OrderByDescending(sort => sort.name1).OrderBy(sort2 => sort2.name2);;
This isn't correct.Because IOrderedEnumerable<telement> inherits from IEnumerable<t>, you can call OrderBy or OrderByDescending on the results of a call to OrderBy, OrderByDescending, ThenBy or ThenByDescending. Doing this introduces a new primary ordering that ignores the previously established ordering.
You need to use ThenBy[^] for the second stage of the sort.
var r = records.OrderByDescending(sort => sort.name1).ThenBy(sort2 => sort2.name2);
Simon
|
|
|
|
|
There are lots of ways of sorting the list: see here[^].
I would suggest you implement the IComparable<T>[^] interface and provide an appropriate body for CompareTo method. You can find such an example here[^].
Ramkithepower wrote: Now I have to sort this class first by name1 and then by name2.
In this case a possible implementation of the CompareTo method could be:
public int CompareTo(Record other)
{
int res = name1.CompareTo(other.name1);
if(res == 0)
res = name2.CompareTo(other.name2);
return res;
}
|
|
|
|