制作内幕 游戏 网站 图标 | 理论 图标在线制作 | 看图软件 访谈活动 | 教程 技术 万年历
当前位置:首页>CG 教 程>网站开发>ASP.NET>

相关文章

推荐文章

     

热门文章

在 ASp+ 中的一些可能会用到的 小函数

作者:CG谷 出处: 发布时间:2006-07-11 字体: [ ]

/*
豆腐制作 都是精品
http://www.asp888.net 豆腐技术站
如果您转贴 本文 请 保留版权信息
*/

<script language="vb" runat="server">
Public Function DateDemo()
'得到今天的日期
dim dt as datetime
dim s as string
s = "今天是: "
dt = Now()
s= s & dt.year() & "年"
s= s & (dt.month()+1) & "月"
s= s & dt.Day() & "日"
return s
End Function
</script>
在 C# 中调用系统当前时间
using System.Globalization;

DateTime dt = DateTime.Now;
string now = dt.Format("f",DateTimeFormatInfo.CurrentInfo).ToString();
将字符串转换为 整数
string v = "24";
int x = v.ToInt32();

得到访问者 Ip 地址

<%@ Page Language="C#" %>
<%
string var;
var = Request.ServerVariables["REMOTE_ADDR"];
Response.Write ("REMOTE_ADDR = " + var + "<br>");
%>
在 C# 中用指定的字符串 替换 另外的一个字符串里的内容
using System;
using System.Text.RegularExpressions;

string myString;
myString = "This is a test.";
myString = Regex.Replace(myString, " is", " was");

作者:豆腐()


↑返回顶部   打印本页   关闭窗口↓  
收藏本文到:天极网摘 新浪VIVI 和讯网摘 博彩中心 365Key网摘 poco网摘 狐摘
亿友响享Yeeyoo igooi-it网摘 5seek网摘 I2Key 我摘网摘 天下图摘 YouNote 百特门
用户名: 新注册) 密码: 匿名评论 [所有评论]
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
设计服务 | 广告投放 | 友情链接 | 关于本站 | 联系我们 | 版权声明 | 设为首页 | 加入收藏