469,964 Members | 1,713 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

cen someone convert this please

Hi,
Can someone convert this to VB.NET Please. I am trying but for some reason
it doesn't work.

if (null != Request.QueryString["secondsToWait"])
{
secondsToWait = Request.QueryString["secondsToWait"];
if ((Int32.Parse(secondsToWait) % 60 == 0)
&& ((Int32.Parse(secondsToWait)) / 60) > 1)
{
int minutes = Int32.Parse(secondsToWait) / 60;
minutesToWait = minutes.ToString();
secondsToWait = "0";
}
}
if (null != Request.QueryString["minutesToWait"])
{
secondsToWait = "0";
minutesToWait = Request.QueryString["minutesToWait"];
}

Thanks
Nov 18 '05 #1
2 1141
It is easy enough to convert, but I am not sure that is what you really want.
For example:

'These will be String.Empty if the Request is NULL (Nothing)
Dim secondsToWait As String = Request.QueryString("secondsToWait")
Dim minutesToWait As String = Request.QueryString("minutesToWait")

If (minutesToWait <> String.Empty) Then
secondsToWait="0"
Else
Dim seconds As Int = Int32.Parse(secondsToWait)
Dim minutes As Int = seconds/60

If (seconds Mod 60 = 0) AND (minutes > 1) Then
minutesToWait = minutes.ToString()
secondsToWait = "0"
End If

End If
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Chris" wrote:
Hi,
Can someone convert this to VB.NET Please. I am trying but for some reason
it doesn't work.

if (null != Request.QueryString["secondsToWait"])
{
secondsToWait = Request.QueryString["secondsToWait"];
if ((Int32.Parse(secondsToWait) % 60 == 0)
&& ((Int32.Parse(secondsToWait)) / 60) > 1)
{
int minutes = Int32.Parse(secondsToWait) / 60;
minutesToWait = minutes.ToString();
secondsToWait = "0";
}
}
if (null != Request.QueryString["minutesToWait"])
{
secondsToWait = "0";
minutesToWait = Request.QueryString["minutesToWait"];
}

Thanks

Nov 18 '05 #2
HI Chris..
Next time you want to convert..go here:-
http://www.kamalpatel.net/ConvertCSharp2VB.aspx
Enjoy

"Chris" wrote:
Hi,
Can someone convert this to VB.NET Please. I am trying but for some reason
it doesn't work.

if (null != Request.QueryString["secondsToWait"])
{
secondsToWait = Request.QueryString["secondsToWait"];
if ((Int32.Parse(secondsToWait) % 60 == 0)
&& ((Int32.Parse(secondsToWait)) / 60) > 1)
{
int minutes = Int32.Parse(secondsToWait) / 60;
minutesToWait = minutes.ToString();
secondsToWait = "0";
}
}
if (null != Request.QueryString["minutesToWait"])
{
secondsToWait = "0";
minutesToWait = Request.QueryString["minutesToWait"];
}

Thanks

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Scott | last post: by
5 posts views Thread by Greg Collins [InfoPath MVP] | last post: by
5 posts views Thread by jignasuk | last post: by
14 posts views Thread by ThazKool | last post: by
11 posts views Thread by Adrian | last post: by
6 posts views Thread by Bob Altman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.