/*
Tofu is made of excellent products
Http://www.asp888.net bean curd technology station
If you post this article, please retain the copyright information
*/
<Script language = "vb" runat = "server">
Public Function DateDemo ()
Get the date of today
Dim dt as datetime
Dim s as string
S = "today is :"
Dt = Now ()
S = s & dt. year () & "year"
S = s & (dt. month () + 1) & "month"
S = s & dt. Day () & "Day"
Return s
End Function
</Script>
Call the current system time in C #
Using System. Globalization;
DateTime dt = DateTime. Now;
String now = dt. Format ("f", DateTimeFormatInfo. CurrentInfo). ToString ();
Converts a string to an integer.
String v = "24 ";
Int x = v. ToInt32 ();
Obtain the visitor Ip Address
<% @ Page Language = "C #" %>
<%
String var;
Var = Request. ServerVariables ["REMOTE_ADDR"];
Response. Write ("REMOTE_ADDR =" + var + "<br> ");
%>
In C #, replace the content in another string with the specified string
Using System;
Using System. Text. RegularExpressions;
String myString;
MyString = "This is a test .";
MyString = Regex. Replace (myString, "is", "was ");
Author: tofu ()