|
hi
i want to create trial version from my app and after it was Expired, end user can't restore windows and use it again. How to do ?
thanks ..
|
|
|
|
|
You can add an entry in the registry which consists of the date of installation and the expiry date.
You can check this value when the app starts if the date has reached just delete the registry entry and the app should not be executed if the registry entry is not present.
Hope that works for u.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
The registry entry will have to be created every time you install the application, so after expiration you'll just have to reinstall to get another trial period.
It'll also be saved if you create an image of your windows after installation.
And there are tools out there that can easily track all modifications done to the registry so you can see which registry key is being created.
I'm afraid there is no really watertight way to achieve this when only a single computer is concerned (i.e. without some sort of online activation).
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
If you dont mind using a commercial tool, take a look at CryptoLicensing
It can limit licenses to N number of days.
|
|
|
|
|
I create a class file dynamically and save it on the file system in a class.cs file.
How can I load that file as a class object and bind it to PropertyGrid?
Thanks.
|
|
|
|
|
You'll have to dynamically compile your generated class file (take a look at the Microsoft.CSharp and System.CodeDom.Compiler namespace), load the generated assembly and create an object of your class using Activator class.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I guess you would have to compile the class into an assembly first. Then load the compiled assembly and create an instance of the class and then bind it to the propertygrid.
If you need details, just ask.
|
|
|
|
|
I need details please .
|
|
|
|
|
I can not figure out why the Page_Load is fired twice. Searched every where. Microsoft support says bug with smartnav but we are not using smartNavigation.
Can anybody help me resolve this mystery.
Thanks
-- modified at 17:36 Thursday 12th October, 2006
|
|
|
|
|
Doing any Server.Transfers or such within the page that you might be redirecting back to itself .
I would actually step through the breakpoint of the Page_Load as it enters it for the first time. From there, see where it goes...it might be there is something in your code producing your problem.
|
|
|
|
|
I've written a Service. OnStarts starts a new Thread which will periodically perform some action. Everything works as expected. The only problem is, that the action which should be performed is, goes like this:
ProcessStartInfo psi = new ProcessStartInfo(sFilePath, sArguments);
try
{
Process.Start(psi);
}
catch (Exception e)
{
}
Something goes wrong here, because the process is not started and an exception is not thrown either. Can somebody please tell me why? Does it have to do something with the service interacting with the desktop? If so, how can I allow this programatically?
I hate to say it, but it is urgent...
Thanks a truckload in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
Well, a windows service runs under the 'System' user account. It could be related to that. My best suggestion is to startup the service and then attach to the process using Visual Studio and debug it. Just remember to build the debug version of the service, install it, and start it.
It can be found from 'Debug' -> 'Attach to Process'.
or you can include this line into your code right before you start the process.
System.Diagnostics.Debugger.Launch();
That should do it.
|
|
|
|
|
hi andrew,
first of all, thanks for your reply. I've attached the debugger. here is what I found out so far: the process is actually started but not visible for some reason. I can see it in the task manager. I guess it has something to do with allowing a service to interact with the desktop. I'm gonna google on this one.
If somebody knows how to allow a service to interact with the desktop, please let me know.
many thanks in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
There was actually a question just a few threads below yours that asked that very same question.
http://www.codeproject.com/script/comments/forums.asp?msg=1709786&forumid=1649#xx1709786xx[^]
Though, I would suggest allowing the service to interact with the desktop as it would be a security hole. Using remoting or some other form of interprocess communication would be best...
I would almost suggest an old school approach to having a process running in the background for a user - the startup menu. You could have the process started when the user logs in and begin minimized (use a parameter for such) and remain in the icon tray. From there, the process would be able to poll events and interact with the user with less risk of security issues.
Just a thought. Good luck.
|
|
|
|
|
hi all,
please help me with this.
i am not able to get the selected value in a dropdown list
DataSet dsLoadDDLState=new DataSet();
dsLoadDDLState=objContactDetails.LoadState();
ddlState.DataSource=dsLoadDDLState.Tables[0];
ddlState.DataMember="State_Id";
ddlState.DataValueField="State_Name";
ddlState.DataBind();
string str=ddlState.SelectedValue;
|
|
|
|
|
What happens when you run the supplied code? just looking at it quickly without the rest of the code, it looks like str would alwyas equal the default selected value. If im not mistaken you would need to use the 'SelectedIndexChanged' event so that when you made a choice then str would be assigned the value clicked
|
|
|
|
|
Can someone please explain why one is correct/better or incorrect/worse?
public class Gatorade
{
public Gatorade(){}
private ArrayList _Ingrediants = null;
public ArrayList Ingrediants
{
get
{
if (_Ingrediants == null)
{
_Ingrediants = new ArrayList();
}
return _Ingrediants;
}
set { _Ingrediants = value;}
}
public void IngrediantsList()
{
_Ingrediants = new ArrayList();
this._Ingrediants.Add("Water");
this._Ingrediants.Add("Sucrose Syrup");
this.Ingrediants.Add("Water");
this.Ingrediants.Add("Sucrose Syrup");
}
}
If I do this.Ingrediants.Add("Water"); then I dont have to manually instantiate _Ingrediants but this way I am accessing the public property. Please advice. Thanks.
|
|
|
|
|
robert110 wrote: public ArrayList Ingrediants
In most cases you don't whant to do:
public ArrayList Ingrediants
To initialize the object:
private ArrayList _Ingrediants = new ArrayList();
To expose contents of the list publicly use IEnumeration or IList or something rather than returning the reference to the list.
led mike
|
|
|
|
|
robert110 wrote: public void IngrediantsList() { /* Should I Do This */ _Ingrediants = new ArrayList(); this._Ingrediants.Add("Water"); this._Ingrediants.Add("Sucrose Syrup"); /* Or This: */ this.Ingrediants.Add("Water"); this.Ingrediants.Add("Sucrose Syrup"); }
I would rather code like this:
public Gatorade()
{
_Ingrediants = new ArrayList(0);
}
public ArrayList Ingrediants
{
get
{
if (_Ingrediants.Count == 0)
{
this.IngrediantsList();
}
return _Ingrediants;
}
}
private void IngrediantsList()
{
this._Ingrediants.Add("Water");
this._Ingrediants.Add("Sucrose Syrup");
}
of course _Ingredients is a private variable. Do not expose method when it is not necessary. Follow good encapsulation.
|
|
|
|
|
i need to create a font property to a control that i have created ,
can someone help me ?
|
|
|
|
|
Hello,
I think you have to pick one of these possibilities.
public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
}
}
private Font _font;
public new Font Font
{
get
{
return _font;
}
set
{
_font = value;
}
}
public new Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
}
}
private Font _myfont;
public Font MyFont
{
get
{
return myfont;
}
set
{
myfont = value;
}
}
Hope you found youre solution!
All the best,
Martin
|
|
|
|
|
Hi!
I have a textfile which contains Name and Value (each name has a value). I want to display ONLY the names in a listbox. And it should be the names with the 10 highest scores. The highest score first...
I do know how to fill the listbox with all the names. But I cant get around to the other...any suggestions?
Newbie untill I die!
|
|
|
|
|
Show us how your txt is formatted
If it's something like "name=value" then you could do something like that
a) string[] lines = File.ReadAllLines("highscores.txt")
b) create a class:
struct Highscore
{
public string name;
public int score;
}
b)
List<Highscore> scores = new List<Highscore>();
foreach line in lines {
Highscore h = new Highscore();
h.name = line.Substring(0, line.IndexOf('='));
h.score = int.Parse(line.Substring(line.IndexOf('=')+1));
scores.Add(h);
}
c)
scores.Sort(... some IComparer to sort for score ...)
d)
for(int i=0; i<10; i++)
listbox.Add(scores[i].name);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
peter 0,333333333333333
peter 1,33333333333333
thats how its look like
Newbie untill I die!
|
|
|
|
|
Hi everyone,
Posting for the first time here - this looks to be a very active forum.
I have some data in an htm file, enclosed in "pre" tags (well at least the beginning tag is there). It looks like this:
<small>----- --------- ----- --------- ---- ------------------------------------- ---------------- ---------- -------- ---------------- ----------------------
Official Pace Chip Gender Category Split Split Split
Place Gun Time km Time # Name City Plce/Tot Plce/Tot Category @10km @15km @20km
----- --------- ----- --------- ---- ------------------------------------- ---------------- ---------- -------- ---------------- ----------------------
1 1:37:58.2 3:16 1:37:58.2 3 BETCHIM, NOURDDINE Montreal 1/2297 1/277 Men 30 - 34 32:37 49:24 1:05:25
2 1:37:59.9 3:16 1:37:59.2 2 NSENGIYUMVA, JOSEPH Ottawa 2/2297 1/140 Men 25 - 29 32:37 49:23 1:05:26
3 1:38:50.0 3:18 1:38:50.0 5 DEHBI, AMOR Montreal 3/2297 2/277 Men 30 - 34 32:37 49:23 1:05:46
4 1:40:15.4 3:21 1:40:15.4 7 KASSAP, DANNY Toronto 4/2297 1/52 Men 20 - 24 32:38 49:23 1:05:35
5 1:42:04.6 3:25 1:42:04.6 19 PAULING, RYAN Rochester 5/2297 2/140 Men 25 - 29 33:34 50:50 1:07:50
6 1:42:25.0 3:25 1:42:25.0 1817 VOLLMER, MARK Guelph 6/2297 3/140 Men 25 - 29 33:33 50:49 1:07:49
7 1:43:10.6 3:27 1:43:10.6 12 GRAF, ERIC Meadville 7/2297 4/140 Men 25 - 29 33:48 51:22 1:08:27
8 1:43:14.8 3:27 1:43:13.8 16 PRINCIC, DANIEL Meadville 8/2297 5/140 Men 25 - 29 34:46 52:03 1:08:42
9 1:43:19.5 3:27 1:43:18.8 4462 KEMP, PAUL Toronto 9/2297 1/354 Men 35 - 39 34:12 51:33 1:08:25
10 1:43:44.5 3:28 1:43:42.9 1256 MACDONALD, JAY Hamilton 10/2297 6/140 Men 25 - 29 33:33 50:50 1:07:49 </small>
I'd like to convert this to XML, I think it's best to do this programmatically. I'm considering using C# or Perl to do this, but I'm open to other ideas. I have the following questions:
- With Perl, setting up my regex will be elegant, but I don't know if Active Perl has any way of producing an XML file.
- With C#, it might be faster, but I don't know what class I would use to produce the XML and serialize it to disk.
All information and advice is welcome!
Thanks a lot,
Richard
|
|
|
|