ASP.NET FAQ - Basic

Find answers for the most frequently asked questions
Expand All Collapse All

You need a stream to read the response, WebResponse.GetResponseStream(), and a stream to write it to the hard drive. FileStream should do the trick. You’ll have to write to the filestream what you read from the response stream.

Permalink

VB.NET


Dim t1 As String = DateTime.Parse('3:30 PM').ToString('t')
Dim t2 As String = DateTime.Now.ToString('t')
If DateTime.Compare(DateTime.Parse(t1), DateTime.Parse(t2)) < 0 Then
	Response.Write(t1.ToString() & ' is < than ' & t2.ToString())
Else
	Response.Write(t1.ToString() & ' is > than ' & t2.ToString())
End If

C#


string  t1    = DateTime.Parse('3:30 PM').ToString('t');
string t2  = DateTime.Now.ToString('t');
if (DateTime.Compare(DateTime.Parse (t1), DateTime.Parse (t2)) < 0 )
{
	Response.Write(t1.ToString() + ' is < than ' + t2.ToString());
}
else
{
	Response.Write(t1.ToString() + ' is > than ' + t2.ToString());
}
Permalink

Share with

Couldn't find the FAQs you're looking for?

Please submit your question and answer.