|
If you need a unique number that is always the same when regenerated, you can always ask a hashcode on a unique string, as long as you manage to create the same string. Here is a modified version of the previous answer to illustrate the idea:
Guid guid = new Guid();
guid = Guid.NewGuid();
string unique = guid.ToString();
int uniqueInt = unique.GetHashCode();
Jean-Christophe Grégoire
|
|
|
|
|
I want to generate unique id for a particular purpose
ie Generating Unique Key for a Computer for Licensing Purpose
|
|
|
|
|
sumit7034 wrote: Unique Key for a Computer for Licensing Purpose
GUID represents a globally unique identifier. So do not worry.
Tan Li
I Love KongFu~
|
|
|
|
|
Every time it generate a new id. i don't want this
i want a unique id for a particular pc
so that it don't match with the id of other computer
|
|
|
|
|
I see, in this case, you can use the MAC address as the unique ID for PC. Of cource, you can also generate the license file through MD5. Everytime the app runs, check the license file firstly.
Tan Li
I Love KongFu~
|
|
|
|
|
This[^] article does something similar to what you need. Might help.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
Hello everyone,
I am developing a WCF service, any ideas about how to track the number of current client connections to the WCF service?
thanks in advance,
George
|
|
|
|
|
How to set the scrollbar of Multiline textbox to the bottom.
eg:
Like chat window, the scrollbar always set to the bottom or the view of the text always to the last entered line.
Regards,
YPKI
|
|
|
|
|
Hi,
make sure the caret is at the end of the TextBox, then call TextBox.ScrollToCaret()
|
|
|
|
|
Why donot you try RichTextbox? It is quite simple to implement this function.
Code as below:
this.richTextBox1.HideSelection = false;
this.richTextBox1.AppendText("asdf" + Environment.NewLine);
Tan Li
I Love KongFu~
|
|
|
|
|
you can force multiline textbox to select and display the last line.
actually, it is similar to realize this function with either multiline textbox and richtextbox
|
|
|
|
|
I'm trying to save some data about controls at runtime and am having a hard time getting the Namespace that the control lives in.
If I'm looking at a form I can just use frm.GetType().FullName and I get back Namespace.FormName.
If I'm looking at a User Control calling ctrl.GetType().FullName only returns the name of the control class. How can I retrieve the missing Namespace data?
|
|
|
|
|
Is it possible? The FullName property will contains the namespace info. Can you paste some relevant code?
Tan Li
I Love KongFu~
|
|
|
|
|
This problem may have been a random bug. Once the machine was rebooted the namespaces began appearing. Weird.
|
|
|
|
|
I have created a windows executable program via a C# VS 2005 project. This is not a published or 'Click Once' project. I also created a setup and deployment project for this application, and built the corresponding "setup.exe" and .msi files for the install. Within this setup and deployment project I created a shortcut to point at the windows executable, and have placed this shortcut in the 'User's Program Menu' special folder.
When I install this application on a PC with XP or Vista operating systems everything appears to go fine, and the shortcut in the user's program menu is created. However, when I click the shortcut it always searches for the ".msi" file used in the installation, and if I have removed the flash drive I installed the application from, the shortcut will not work. I need to delete the shortcut included with the install, and create a new shortcut that points at the installed executable, to avoid this problem.
Does anyone know, or have any thoughts, as to why the shortcut I am installing via the 'Setup and Deployment' project always needs access to the ".msi" file to work? Like I said, I have not published or, at least not intentionally, built this application as a 'Click Once' project.
Thanks...
|
|
|
|
|
What is the target of the shortcut? Make sure its to the exe.
only two letters away from being an asset
|
|
|
|
|
FWIW, the target is fine, it is the EXE. I must have some setting that is forcing the project to act like a click once, published project. But I'm obviously not seeing the forest for the trees.
|
|
|
|
|
You checked the properties to make sure ClickOnce wasn't checked I assume. I've seen this behavior with other apps, it may not have anything to do with yours, it could be a dependency that isn't present. Have you tried on other machines?
only two letters away from being an asset
|
|
|
|
|
Thanks for the responses, but ClickOnce is definitely not checked. I imagine if a dependency was not present then I still would be having problems after deleting and manually re-creating the shortcut in the Program's menu, but everything is fine when the shortcut is manually created.
I've tried the install on multiple machines using XP or Vista operating systems with the same result. Fortunately the installation does not need to be done on very many machines, so I'm going to throw in the towel for the time being and just manually create the shortcut.
|
|
|
|
|
Shame you never got an answer on this one. I have the same issue. I thought I must be doing something wrong, but can't work out what it is.
Did you ever work it out?
Thought it maybe because I made the shortcut to the Primary Output of xyz Project, but your post said you made it to the exe
|
|
|
|
|
Yeah, I did sort of work it out. Turns out that, by default, that is apparently automatically how VS 2005 does its setups; and I do not believe there is an override. So instead I used the 'Orca MSI Editor' tool to modify the installer created by VS 2005 to use the shortcut I wanted. If you are unfamiliar with the tool, google for Orca MSI Editor and you will find some downloads. I believe it does come with the Windows Installer SDK, but you can download just that tool if you do not want the entire SDK.
|
|
|
|
|
|
Are there any differences between these two assignment ?thanks
char com[2]="my text;
string com[2]="my text";
|
|
|
|
|
an82 wrote: Are there any differences between these two assignment ?thanks
char com[2]="my text;
string com[2]="my text";
Not really. They are both nonsense.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
sorry:
char com[2]="my text";
string com[2]="my text";
|
|
|
|