|
I am writing a C# program which will store the date of installation of the program on user machine along with the Disk Volume ID in an encrypted form, for trial period authentication. This information is generated by the program at the time of the first run. The problem is where to store this information on the user machine so that the user (including the administrator) cannot delete the same. Because if the user could find out where the information is stored (in a file or otherwise), he can simply delete the same and install the program again, which would re-initialize the date of installation. This will defeat the purpose.
So, some cross-check is required to be built so that if the user deletes this file or information, still on re-installation of the program, the cross-check can give the "true" information to the program about the installation date.
Any suggestions or ideas as to where this "cross-check" could be stored in a "safe" manner?
|
|
|
|
|
I would do it by installing a second copy of the same key somewhere else, so that if the first one is deleted, the second one can be checked. If you can encode this info into a file that you write to the hard drive, and call something.dll, or some other obsfucated name, that would be perfect.
No protection is fool proof, though.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thanks for your suggestion.
|
|
|
|
|
When typing text into arich text box and I hit enter no new line is created. Is there a property to change to allow the user to create as many new lines as they would like?
thanks
|
|
|
|
|
Yes, there is a MultiLine property, which you have to assign True.
Happy Coding!!!
|
|
|
|
|
Thanks Ali. I have set that property to true and it is still the same.
|
|
|
|
|
Please re-check your code.
The multiline property is the only one responsible for this effect and is set to true by default, so Ali's reply is absolutely correct.
Are you handling any key events yourself?
Regards,
mav
|
|
|
|
|
hi
i want to create new folder in my website programmaticaly.
how i can do it?
tanks
|
|
|
|
|
Same way you'd create a folder anywhere, the only issue is making sure you have the permission to do so, as the user you're logged in as within the site.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
With the standard treeview when a user right clicks a node to show a context menu the selected item does not change. I want to force this change. Is it possible and if so how?
Thanks for any help.
|
|
|
|
|
If there's an event you can catch for the right click, then a tree view has a method for finding the item under the mouse ( assuming it's not passed into the event handler ) and you can select it there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You can subscribe to the MouseDown event and use the following piece of code.
if (e.Button == MouseButtons.Right)
{
TreeNode node = treeView.GetNodeAt(e.X, e.Y);
if (node != null)
treeView.SelectedNode = node;
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I came up with what I think is a good idea for making multithreading programming easier in any .NET language. .NET 2.0 adds the capability to write anonymous functions, it would be nice if there was a "parallel" statement, that could simplify writing threadprocs
<br />
public void DoSomeParallelStuff() {<br />
parallel<br />
{<br />
{<br />
}<br />
{<br />
}<br />
{<br />
}<br />
}<br />
<br />
}<br />
behind the scenes the compiler could create the anonymous functions, add them to the ThreadPool by calling ThreadPool.QueueUserWorkItem. in some cases it would be nice to automatically block the caller thread, maybe a sister statement "parallel-blocked"
<br />
parrallel-blocked {<br />
{<br />
StreamReader rd = new StreamReader("C:\test.txt");<br />
...<br />
}<br />
{<br />
StreamReader rd = new StreamReader("D:\test.txt");<br />
...<br />
}<br />
}<br />
<br />
Console.WriteLine("Tasks complete");<br />
I think this would make it much easier to write multithread capable code. I've actually added this feature to a compiler I'm working on and it works quite nicely.
60% of statistics are made up on the spot
|
|
|
|
|
That would definitely be drool-worthy. Send a proposal to Microsoft and maybe it will see fruitation!
|
|
|
|
|
I would like to read some articles for beginners concerning the creation and use of dll. Can you give me some sites?
|
|
|
|
|
|
how can I find out the volume name of a CD (or another drive) ?
|
|
|
|
|
You'll need to P/Invoke GetVolumeInformation
Have a look at this article[^],
|
|
|
|
|
|
I have a custom control which inherits from Windows.Forms.Label - it adds some field and properties which enable the user to draw a color border around it. In the OnDraw method i first call base.OnPaint, and then draw the border. It has a disadvantage - some text may become covered by the border. Is there a way to avoid this? I can draw the text myself in a smaller rectangle than the client rectangle, but then I loose the control's ability to dynamically wrap the text. Help me!
|
|
|
|
|
Try to make the text aligment in the middle horizontal of the label
|
|
|
|
|
Yes, it works, bu I want to be able to have all the remaining styles to choose from. Any other options?
|
|
|
|
|
Just don't make the custom border so thick .
|
|
|
|
|
Hi All,
I'm having a problem with TraceSwitches. When I create one it doesn't seem to read the values from the XML .config file and nothing gets logged. Here's what I have done:
1) I've created a TraceSwitch:
static public TraceSwitch Logger = new TraceSwitch("TDLog", "Application Log");
2) I created a file stream:
FileStream filestream = new FileStream("c:\mylogfile.log", FileMode.Create);
3) I've created a <b>TextWriterTraceListener</b>
private TextWriterTraceListener _logfile = new TextWriterTraceListener(filestream);
4) I've added the TextWriterTraceListener to the Listeners collection:
Trace.Listeners.Add(_logfile);
5) I've also set up a .config file to give startup parameters to the TraceSwitch (the config file is called: myapp.exe.config since my app is called: myapp.exe. Here is the contents o my .config file:
<configuration>
<system.diagnostics>
<switches>
<add name="TDLog" value="4" />
<trace autoflush="true" />
</switches>
</system.diagnostics>
</configuration>
When my app run the Trace Level is initiall set to OFF dispite the fact I set it to verbose explicitly inside the .config file. For good measure I've also added a #define TRACE in the top of my .cs file to no avail. Any ideas on what I'm doing wrong ? Thanks in advance...
-Pete
|
|
|
|
|
Hello All,
I have several COM components that I reference. Unfortunately, they are referenced at a rather low level of the solution, which makes strongly naming the projects within the solution difficult. I have seen a couple of "work around" ways to strongly name those COM components, which enables me to strongly name the rest of my project. I was wondering if anyone had a good suggestion as to the best way to strongly name referenced COM components.
Thanks in advance for the advice,
Ryan
|
|
|
|