How to clear the Calendar Control Selection
VB.NET Calendar1.SelectedDate =new DateTime() C# Calendar1.SelectedDate =new DateTime();
How to convert string to a DateTime and compare it with another DateTime
VB.NET Dim blntimeIsOk As Boolean = DateTime.Parse('15:00') < DateTime.Parse('08:00') Response.Write(blntimeIsOk) C# bool blntimeIsOk = (DateTime.Parse('15:00') < DateTime.Parse('08:00')); Response.Write (blntimeIsOk);
How to get the current filename
VB.NET Response.Write (Path.GetFileName(Request.PhysicalPath)) C# Response.Write (Path.GetFileName(Request.PhysicalPath));
How to get the physical path of a file
Use Request.Path
How can I scan a string to determine if it contains DBCS chars?
VB.NET Public Shared Function IsAsciiString(s As [String]) As Boolean Dim i As Integer For i = 0 To s.Length - 1 Dim ch As Char = s(i) If ch < 0 Or ch > 127 Then Return False End If Next Return True End Function ’IsAsciiString ’In Page_Load dim originalString as string = 'a±' Response.Write (IsAsciiString(originalString)) C# public static bool IsAsciiString(String s) { for (int i = 0; i < s.Length; i++) { char ch = s[i]; if (ch < 0 || ch > 127) return false; } return true; } //In Page_Load String originalString = 'a±' ; Response.Write (IsAsciiString(originalString));