I downloaded a web timer control from
http://www.eggheadcafe.com/articles/20021006.asp and it's written in C#. The
code and .DLL comes with the download so I'm trying to convert the sample
which was written in C# to VB (ASP.NET). Here is the following code in the
Default.aspx page...
private void PgTimer1_Elapsed(object sender, System.EventArgs e)
{
if (Application["PgTimer"] == null)
{
Application["PgTimer"] = 0;
}
string strResult = "Elapsed Event: " + DateTime.Now.Millisecond;
Application["PgTimer"] = (int)Application["PgTimer"] + 1;
Response.Write("Instance: " + Application["PgTimer"].ToString() + ": " +
strResult);
}
Can anyone help me convert this to its VB.NET equivalent?
Here is what I have so far...
Private Sub PgTimer1_Elapsed(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PgTimer1.Elapsed
Dim strResult As String
Dim intNum As Integer
strResult = "Elapsed Event: " & DateTime.Now.Millisecond
' The following line is just a placeholder only until I figure out
' how to convert the following C# code.
'
' Application["PgTimer"] = (int)Application["PgTimer"] + 1;
intNum += 1
Response.Write("Instance: " & intNum.ToString() & ": " + strResult)
End Sub