troubleshooting Question

Help needed with a tutorial.

Avatar of Peter Kiers
Peter KiersFlag for Netherlands asked on
.NET Programming
2 Comments1 Solution226 ViewsLast Modified:

I have received a tutorial "How to add a two week trial to your application".
from my previous question. I think this is the answer I am looking for.

But I think its not that well documented and its in VB and I use C#.
So I use to convert it. I think I have to asked
a lot of questions on EE to get this done. Because I can not do this alone!

Its about this article:

And I get stuck at the first code-example:

01       Dim intTime As Integer = 1
02	Dim dteLastStart, dteStartDate As Date
03	Dim blnFirstTime, blnEnabled As Boolean
04	Dim lngTimeLeft As Long
06	blnEnabled = True
07	If dteStartDate = Nothing Then
08	    dteStartDate = Now
09	End If
11	My.Application.SaveMySettingsOnExit = True

And I have this:

namespace WindowsFormsApplication1
    public partial class Form1 : Form
        RegForm frmRegister = new RegForm();
        int intTime = 1;
        System.DateTime dteStartDate = default(System.DateTime);  
        System.DateTime dteLastStart = default(System.DateTime);
        bool blnFirstTime = false; 
        bool blnEnabled = false;
        long lngTimeLeft = 0;

        public Form1()

        private void registerProductToolStripMenuItem_Click(object sender, EventArgs e)
            if (frmRegister.ShowDialog() == System.Windows.Forms.DialogResult.OK)

        private void Form1_Load(object sender, EventArgs e)
            blnEnabled = true;
            if (dteStartDate == null)
                dteStartDate = DateTime.Now;

            my.Application.SaveMySettingsOnExit = true;


My questions:
1. In the tutorial it doesn't say what event to use so I have used the load-event.
    is this correct.
2. I have an error at line: "my.Application.SaveMySettingsOnExit = true;"
    and the error saids: "The name 'my' does not exist in the current context".
3. And what does the line at 2 means. What does it do?

Who is willing to help me?

Dirk Haest
Project manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros