我有个文件叫cookie.cs,文件内容如下:
那么我怎么在其他cs文件中调用cookie.cs文件中函数CreateCookieValue?using System.Web;
public partial class cookie : System.Web.UI.Page
{
private void CreateCookieValue(string cookieName, string cookieValue, DateTime cookieTime)
{
.............
}
}
那么我怎么在其他cs文件中调用cookie.cs文件中函数CreateCookieValue?using System.Web;
public partial class cookie : System.Web.UI.Page
{
private void CreateCookieValue(string cookieName, string cookieValue, DateTime cookieTime)
{
.............
}
}
xxxx=ck.CreateCookieValue(xxx,xxx,xx)'
感觉应该加的,但具体怎么写,我就不知道了.
utils.cs文件内容:
{
public class Utils
{
public static int GetStringLength(string str)
{
return Encoding.Default.GetBytes(str).Length;
}
}
}
Default2.aspx文件内容
namespace Ke.Common
{
public partial class aspx_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int xx = GetStringLength("aaaaa"); }
}
}
应该是
int xx = Utils.GetStringLength("aaaaa");谢谢各位