|
Hi,
I want to create a demo for an application I have created in C# so as to work for only eight days when installed on a client machine
Kezy
|
|
|
|
|
Hi!
So what's the problem?
You have to either save the date of installation or the initial remaining time somewhere and then, during startup, calculate if your still within the demo time range.
But beware - with registy and file system watching programs it's quite easy to find out the location where you save your time information. That way one can always uninstall your app and re-install it to get another 8 days.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
as mav's said pure clientside solutions can easily be defeated. If you can require demo users to have a net connection and you have a 24/7 server you could have your app phone home with system details such as mac address, harddrive serials, etc to your server to ask for permission to run. Organized hackers will still be able to edit your application to disable the checks. If possible limited functionality in a time unlimited demo is probably more effective at forcing a user to go from the demo to the full version of your application, than a fully featured demo with a time limit.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Hi, for creating a demo application that runs only for 8 days, u can enter the date/time settings in a text file, that will be created during the application installation. change the ext of the text file to something else, and during the installation , make it a point to install the file in some safe area of the client machine that normally he does not /cannot access. Also make sure to make the file hidden. This will defeat any attempt to uninstall the app and reinstalling it to get 8 more days, since uninstalling the app will delete only the program related files and not the text file that u create from ur C# code. So each time the application is opened up this file will be checked for some status flag, upon not finding the correct value, the app wont start.Just try this technique on ur machine first.
Cheers
|
|
|
|
|
gladiatron wrote: install the file in some safe area of the client machine that normally he does not /cannot access.
Where would this be? If the user has got the rights to write the file during installation, then he'll be able to get the neccessary access rights to delete the file. Simple as that, nothing you can do about it.
gladiatron wrote: This will defeat any attempt to uninstall the app and reinstalling it to get 8 more days,
What should anyone keep from deleting the file?
Even beginners can have a program monitor the creation of a file, if you try to ofuscate what you're doing by making the file hidden then it's even easier to find.
There are lots of applications that log every file and every registry key written to during an installation and they will easily defeat this overly simplistic scheme.
Using a feature-crippled version or a web-based licensing is much effective.
P.S.: If 'u' follow the forums here '4' a while 'u'll see that people here really don't like people writing 'u' instead of you. The only valid reason to do this is if your keyboard is broken and the Y and O keys are missing, which doesn't seem to be the case on your side.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
How can i get a window's icon? (by it's handle).
Just so it's clear: i'm not talking about my own program's window, but about another window.
|
|
|
|
|
|
Hello I have to obtain a process whose owner is Current User, actually I´m getting a process like this:
string processname1 = "msiexec";
System.Diagnostics.Process[] myprocess1 = System.Diagnostics.Process.GetProcessesByName(processname1);
But there are two instances of the process, one Current user’s process and the system´s process.
Thank you!!!
José Guzman
|
|
|
|
|
You can P/Invoke OpenProcessToken[^]. Get the token information and check if the username and the process name are the one you want and do the operation you need to do
Or use WMI
System.Management.ManagementObjectSearcher moSearch;
string sQuery = "";
System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("msiexec");
foreach (System.Diagnostics.Process p in processes)
{
sQuery = "Select * From Win32_Process Where ProcessID = " + p.Id;
moSearch = new System.Management.ManagementObjectSearcher(sQuery);
string[] args = new string[5];
foreach (System.Management.ManagementObject mo in moSearch.Get())
{
mo.InvokeMethod("GetOwner", args);
if (args[0] == strCurrentUser)
{
}
}
}
|
|
|
|
|
hi
how can raise an event in c#?
for example in VB.NET we can write follow code to raise an event :
RaiseEvent SendMessage(message);
tanks
|
|
|
|
|
SendMessage(message);
Was it that difficult to figure out
only two letters away from being an asset
|
|
|
|
|
Well i have lil doubt about handling exception...
Well i have created a ABCException class based over Exception class.
which includes ABCException class constructors with differnt parameters like..
class STAFException : Exception
{
public ABCException() {...}
public ABCException(Uint32 cc) {...}
public ABCException(Uint32 cc, string message) : base(message) {...}
public ABCException(string message) : base(message){...}
}
Now my question is ... for instance look at the below mentioned method
<br />
public IDictionary createInstance()<br />
{<br />
Hashtable treemap = new Hashtable();<br />
treemap.Add("map-class-name", _mapClassDef["name"]);<br />
return treemap;<br />
}<br />
So if i want to handle its exception...is the below method correct or am i doing it wrong...
<br />
public IDictionary createInstance()<br />
{<br />
try<br />
{<br />
Hashtable treemap = new Hashtable();<br />
treemap.Add("map-class-name", _mapClassDef["name"]);<br />
return treemap;<br />
}<br />
catch(Exception e)<br />
{<br />
throw new ABCException("unknown exception: " + ee.Message);<br />
}<br />
}<br />
<br />
Is it right way to deal with it...can i use this approach with my other methods aswell..?
Thanks
|
|
|
|
|
Software_Specialist wrote: Is it right way to deal with it...can i use this approach with my other methods aswell..?
If you are going to catch an exception and throw a new one you should add the original exception as an innerException to the existing one. That way you'll still have access to the full stack trace. If you don't do that you are throwing away valuable information.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
And how could i do that..how to add the original exception as an innerException to the existing one ?
Thanks
|
|
|
|
|
Call the appropriate base constructor:
Exception(Exception innerException)<br />
Exception(string message, Exception innerException)
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
I love seeing questions like this from some calling themself Software_Specialist. It gives me hope that there is job security for me.
only two letters away from being an asset
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Have you seen the O/S and toys on cell phones lately? What utter crap!
It's only a matter of time before it's simply not worth having your entire customer base pissed at you because you outsourced software development to a company that has too many people who don't know what their doing. At least I hope that's the case!
|
|
|
|
|
Well, Knuth says programming is an art. How many artists you can see around you?
Of course there are several reasons behind this scenario: There is a strong request for software and employers tend to prefer cheap teams; usually Project Managers insist on deadlines more than on software quality; new languages and tools are often presented as accessible to untrained people (and indeed they are, but good programming has NOT such accessibility) and so on...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: Well, Knuth says programming is an art.
How true that is!
CPallini wrote: How many artists you can see around you?
I'm alone around here, so I'm the only one. This place has probably given me the most frustrating experience of my life simply supporting all the systems around here. The simplest of ideas are the most difficult concepts to get people to do. I mean stuff we would normally just expect to happen automatically is not being done.
For instance, looking a a trouble ticket that says "Computer not working". That's it! Nothing else! WHICH computer? Who's the contact? Who reported the problem? WHAT'S THE FRIGGIN' PROBLEM DESCRIPTION??
Don't get me started about how people write the code that makes up custom systems around here! Talk about unsupportable...
I wish I could just unload the stories upon the "Coding Horrors" forum, but that would get me fired in a heartbeat.
|
|
|
|
|
CPallini wrote: There is a strong request for software and employers tend to prefer cheap teams
Company executives/managers still haven't heard of the phrase "You get what you pay for"!
|
|
|
|
|
Dave Kreskowiak wrote: Company executives/managers still haven't heard of the phrase "You get what you pay for"!
No, they had. The problem is that they don't get the software, they just sell it to other people
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Dave Kreskowiak wrote: Company executives/managers still haven't heard of the phrase "You get what you pay for"!
maybe it does not apply to executives/managers ?
|
|
|
|
|
Oh, it applies to them most of all!
How many compaines have gone under, run by overpaid executives just tem to fleece the company and the shareholders? Enron, Adelphia, KMart, WorldCom, ...
|
|
|
|
|
On top of the InnerException issue, you should not catch general System.Exception. There are very few cases where this is justified.
Keep in mind that you should only catch exceptions that you know how to deal with or where you can add valuable information before throwing it to the calling code where "someone" will know what to do with it.
If you use catch System.Exception you can be catching any kind of exception that you may have no idea how to handle and that most probably you shouldn't even be trying to handle. In these cases wrapping the exception in your own custom made exception and throwing it does not add any valuable information and is completely pointless, you are only bloating the exception information before it reaches some relevant code.
So, analyse you're class and method and see what type of exceptions you can get that can be handled by your class or where your class can add valuable debugging information to the consumer and catch only those exceptions. If not, just don't catch them at all...the calling code will take care of it, or the caller of the calling, etc, etc.
|
|
|
|