Hi,
Further to the discussion with you, i have encountered the following issues when trying to use the turbo activate.dll and turboactivate.dat in our asp.net application. Please find below the same and help us in this.
1. System.windows.form - name space------Cannot use system.windows.form namespace in asp.net C# Coding. The application is not supporting the name space system.windows.form. P.S. Note: I hope the mentioned namespace is only for windows/desktop application. Please suggest what namespace should be used for browser based applications (Asp.net with C# Coding)------2. Trial extension form
I Couldnt Integerate Trialextension form in web based coding. Please let me know how to use this form/functionality.-----
Please review our coding for your reference.
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Diagnostics;using System.IO;
/// <summary>/// Summary description for Class1/// </summary>public class Class1{ bool isActivated; public Class1() { TurboActivate.VersionGUID = "7737869274f4f023565b8f3.30510600";
isActivated = TurboActivate.IsActivated(); ShowTrial(!isActivated);
// if this app is activated then you can get a feature value // See: http://wyday.com/limelm/help/license-features/ /* if (isActivated) { string featureValue = TurboActivate.GetFeatureValue("your feature name");
//TODO: do something with the featureValue } */ } void mnuActDeact_Click(object sender, EventArgs e) { if (isActivated) { // deactivate product without deleting the product key // allows the user to easily reactivate TurboActivate.Deactivate(false); isActivated = false; ShowTrial(true); } else { //Note: you can launch the TurboActivate wizard or you can create you own interface
// launch TurboActivate.exe to get the product key from the user Process TAProcess = new Process { StartInfo = { FileName = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "TurboActivate.exe") }, EnableRaisingEvents = true };
TAProcess.Exited += p_Exited; TAProcess.Start(); } } void p_Exited(object sender, EventArgs e) { // remove the event ((Process)sender).Exited -= p_Exited;
// the UI thread is running asynchronous to TurboActivate closing // that's why we can't call TAIsActivated(); directly Invoke(new IsActivatedDelegate(CheckIfActivated)); }
delegate void IsActivatedDelegate();
void CheckIfActivated() { // recheck if activated if (TurboActivate.IsActivated()) { isActivated = true; ReEnableAppFeatures(); ShowTrial(false); } } void ShowTrial(bool show) { //lblTrialMessage.Visible = show; //btnExtendTrial.Visible = show;
mnuActDeact.Text = show ? "Activate..." : "Deactivate";
if (show) { int trialDaysRemaining = 0;
try { TurboActivate.UseTrial();
// get the number of remaining trial days trialDaysRemaining = TurboActivate.TrialDaysRemaining(); } catch { }
// if no more trial days then disable all app features if (trialDaysRemaining == 0) DisableAppFeatures(); // else //lblTrialMessage.Text = "Your trial expires in " + trialDaysRemaining + " days."; } }
/// <summary> /// Change this function to disable the features of your app. /// </summary> void DisableAppFeatures() { //TODO: disable all the features of the program //txtMain.Enabled = false;
//lblTrialMessage.Text = "The trial has expired. Get an extension at Example.com"; }
/// <summary> /// Change this function to re-enable the features of your app. /// </summary> void ReEnableAppFeatures() { //TODO: re-enable all the features of the program //txtMain.Enabled = true; }
void btnExtendTrial_Click(object sender, EventArgs e) { TrialExtension trialExt = new TrialExtension(); if (trialExt.ShowDialog(this) == DialogResult.OK) { // get the number of remaining trial days int trialDaysRemaining = 0;
try { trialDaysRemaining = TurboActivate.TrialDaysRemaining(); } catch { }
// if more trial days then re-enable all app features if (trialDaysRemaining > 0) { ReEnableAppFeatures(); //lblTrialMessage.Text = "Your trial expires in " + trialDaysRemaining + " days."; } } }}