|
Hi guys,
I have created a windows based project for my client and it works fine for him. He is my client and want to sell this product to further clients, so for this he wants that in deployment of the project a screen should appear that shows about to insert a license key and it must match with a license which is stored in an online database.
Creation of database and checking of license key is I think is not typical, but the typical act is how to create a screen which appears in the deployment of that project and appears at the time of installation.
If any one help me then I will be highly thankful to that person.
Thanks in Advance
|
|
|
|
|
What you are after, sounds like a Splash Screen:
www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx[^]
You can add additional arguments in the code, which check to see if the project is registered or not, and if it is already registered, to not even display the Splash Screen, and just head to the main screen.
|
|
|
|
|
Hi,
I want to display the messages from Queue in consoleapplication.I am able to read the queues.But while displaying, if i had 6 messages in queue and in that i am able to display only 3.Please help me out in solving this.
My code is as follows:
string QueueName = ".\\Private$\\TestQ";
MessageQueue.EnableConnectionCache = false;
//// open the selected message queue
this.messageQueue = new MessageQueue(QueueName, QueueAccessMode.Receive);
while (true)
{
System.Messaging.Message message = new System.Messaging.Message();
MessageQueueTransaction msgTx = new MessageQueueTransaction();
MessageDetails messageDetails = null;
try
{
msgTx.Begin();
message.Formatter = new BinaryMessageFormatter();
message = messageQueue.Receive(new TimeSpan(0, 0, 0, 10), msgTx);
if (message.Body != null)
{
messageDetails = (MessageDetails)message.Body;
Console.WriteLine(messageDetails.ApplicationName + "\t" + messageDetails.ThreadName + "\t" + messageDetails.Status + "\t" + messageDetails.TimeStamp);
}
msgTx.Commit();
messageQueue.BeginReceive();
}
Thanks in Advance
|
|
|
|
|
is messageQueue subscribed to receive the callback from the BeginReceive() call? if not that'll probably discard every other message in the queue.
|
|
|
|
|
I've tried to capture the desktop with the cursor image using different codes and none manages to draw the IBeam cursor. If I use the Cursor.Current, I always get the waitcursor; using API, I get the correct cursor. Is there a workaround?
|
|
|
|
|
Nothing, guys? From what I've seen during my google searches, this is a common problem so I think there must be a workaround. I know that Ibeam is a xor cursor, but I don't know how to get the xor mask using CursorInfo.
|
|
|
|
|
when should we use Convert.ToDouble and Double.Parse
Thanks
|
|
|
|
|
Convert.ToDouble[^] allows you to convert other types to a Double.
Double.Parse[^] parses a string and attempts to convert it to a Double (although normally Double.TryParse[^] would be better).
Learn how to use MSDN and Google - the links I've given were first in the lists on Google!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
|
Why did you feel the need to post this question in no less than 7 different forum?? It's no longer likely your ever going to get an answer to this question seeing as you saw fit to do what everyone hates -> SPAM this site with your question. Pick a single forum most appropriate for your subject, like General Discussions in your case, and post your question ONCE!
|
|
|
|
|
...
Blog link to be reinstated at a later date.
|
|
|
|
|
I have some code that we use to parse the contents of a folder and perform actions based on file dates. We would now like to do the same over our internal network to a location such as http://server.company.com:8080/files. Unfortunately, the DirectoryInfo method does not support this type of path. Is there a similar method that can be used for this type of path?
|
|
|
|
|
I am attempting to write code that sinks an event with only an object reference and the event name - no type information. I write a generic event handler function:
public void ComponentEventHandler(object o, EventArgs e)
{
// handle generic event
}
Then I wrote some code that attaches any event to this event handler function
protected void SinkControlEvent(Control ctrl, string eventName)
{
EventDescriptor event = TypeDescriptor.GetEvents(ctrl)[eventName];
Delegate del = Delegate.CreateDelegate(typeof(System.EventHandler), this, "ComponentEventHandler");
event .AddEventHandler(ctrl, del);
}
This works fine when the event I'm sinking has the standard function signature. However, I get an exception when the event has a derived EventArgs parameter. For example, trying to sink the following event would cause a type mismatch exception:
public event void ValueChanged(object sender, ValueEventArgs e);
The exception is "Invalid event handler for ValueChanged event". Of course 'ValueEventArgs' inherits from EventArgs, so I don't understand why this isn't a valid handler.
Some things to note:
1. You can, in code, assign an untyped event handler to a typed event. Somehow the compiler figures it out.
2. I tried changing my code such that I attach an untyped function to a typed delegate, but that also threw an exception.
Delegate del = Delegate.CreateDelegate(event.EventType, this, "ComponentEventHandler");
Thanks,
Aaron Stibich
|
|
|
|
|
astibich2 wrote: public void ComponentEventHandler(object o, EventArgs e)
Could you not change this to
public void ComponentEventHandler<T>(object sender, T e) where T : EventArgs
|
|
|
|
|
That looks a lot like the EventHandler< T> class
|
|
|
|
|
Well, I thought so, but I can't see what he's trying to do that you can't accomplish normally.
|
|
|
|
|
Hello TCP gurus!
It's me again, standing in a the corner of a room with wet paint all around me.... Any help would be appreciated.
I have a dictionary
public class DataImage : Dictionary<string,>
which has been working wonderfully for me. But now I find that when I have a problem when adding values using the Item property.
DataImage<string,> modImage = new DataImage<string,>();
...
modImage["xxx"] = "yyy";
I need to have some additional actions occur. In particular, DataImage contains some private data that needs to be updated whenever an element is added or removed. I have the required code in the Add() and Remove() methods, but I also need that logic to occur when the dictionary is accessed using its Item property.
I would like to do something akin to
public override string Item[key]
{
get { return base[key]; }
set
{
base[key] = value;
changeOtherStuff(key, value);
}
}
I looked at this page (http://msdn.microsoft.com/en-us/library/9tee9ht2.aspx[^]), but couldn't see how to write the necessary code from it. I also searched online, but to no avail.
Clive Pottinger
Victoria, BC
|
|
|
|
|
cpotting wrote: I also searched online, but to no avail.
They hide that information in the documentation[^]
led mike
|
|
|
|
|
Thank you Mike - exactly the syntax I needed. Now I can hang from ceiling and continue painting the floor...
Clive Pottinger
Victoria, BC
|
|
|
|
|
Few observations:
- when defining Item property (indexer), I believe you should provide type of the key parameter
- indexer is defined using this keyword
- default indexer is not marked virtual so you should use new keyword
So the code should be something like the following
public class DataImage : Dictionary<string,sometype> {
...
public new sometype this[string key} {
get {...
Hope this helps,
Mika
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Thank you too, Mika
Clive Pottinger
Victoria, BC
|
|
|
|
|
sorry. The definition of DataImage should say "string,string", but the display is dropping the second "string". And for some reason, I can't get in to edit to the message.
Clive Pottinger
Victoria, BC
|
|
|
|
|
Hi fellows:
How can I restirct only integers to be entered inside the propertygrid value field. I tried looking into this matter by wasn't quite succesfull. I hope your suggestion can help me.
Thanks
|
|
|
|
|
Search for GridItem. Will Implement one row in a PropertyGrid.
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
I couldn't find much related to GridItem to control user input. Would you be kind enough to provide me with some examples or code or perhaps a useful resource.
Thanks
|
|
|
|