keysObj.Seed = (String)Application.Get("seed"); //此句有问题,要么是SEED值为空,要么是SEED的值不符合格式if (Application.Get("seed") == null)
{
HttpContext.Current.Response.Write("NULL");
HttpContext.Current.Response.End();
}如果这样赋个初值,就没问题了。
keysObj.Seed = "abc";
我的Application("seed") 定义在global.asa里面了<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type><SCRIPT LANGUAGE=VBScript RUNAT="Server"> '*@@@+++@@@@******************************************************************
'
' Microsoft Windows Media
' Copyright (C) Microsoft Corporation. All rights reserved.
'
' IMPORTANT: THESE SAMPLES ARE PROVIDED FOR HIGH-LEVEL REFERENCE ONLY
' AND SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS.
'
'*@@@---@@@@******************************************************************Sub Application_OnStart
'Content Server information. In this sample, we support only one content server.
Application("seed") = "123"End Sub
</SCRIPT>
{
HttpContext.Current.Response.Write("NULL");
HttpContext.Current.Response.End();
}如果这样赋个初值,就没问题了。
keysObj.Seed = "abc";
我的Application("seed") 定义在global.asa里面了<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type><SCRIPT LANGUAGE=VBScript RUNAT="Server"> '*@@@+++@@@@******************************************************************
'
' Microsoft Windows Media
' Copyright (C) Microsoft Corporation. All rights reserved.
'
' IMPORTANT: THESE SAMPLES ARE PROVIDED FOR HIGH-LEVEL REFERENCE ONLY
' AND SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS.
'
'*@@@---@@@@******************************************************************Sub Application_OnStart
'Content Server information. In this sample, we support only one content server.
Application("seed") = "123"End Sub
</SCRIPT>
Application["seed"] = "123" 获取
string a= Application["seed"].ToString();是方括号啊!!