代码如下服务器端
[WebMethod(EnableSession = true)]
public String start()
{ if (Session["logged"] != null)
{
String str;
str = "Welcome to our system please select from the following options" +
"\n*************************************************************" +
"\n1. View our stock" +
"\n2. Buy stocks" +
"\n3. Sell stocks" +
"\n4. View trading report" +
"\n5. View best selling stocks" +
"\n*************************************************************";
return str;
}
else
{
string str= "User not Vaild, Please retry";
return str;
} }客户端:
localhost.Service1SoapClient ws = new StockClient.localhost.Service1SoapClient();
ws.CookieContainer = new System.Net.CookieContainer();//这行报错我有引用服务参考
可是查错时显示 'StockClient.localhost.Service1SoapClient' 不包含 'CookieContainer' 的定义谢谢
[WebMethod(EnableSession = true)]
public String start()
{ if (Session["logged"] != null)
{
String str;
str = "Welcome to our system please select from the following options" +
"\n*************************************************************" +
"\n1. View our stock" +
"\n2. Buy stocks" +
"\n3. Sell stocks" +
"\n4. View trading report" +
"\n5. View best selling stocks" +
"\n*************************************************************";
return str;
}
else
{
string str= "User not Vaild, Please retry";
return str;
} }客户端:
localhost.Service1SoapClient ws = new StockClient.localhost.Service1SoapClient();
ws.CookieContainer = new System.Net.CookieContainer();//这行报错我有引用服务参考
可是查错时显示 'StockClient.localhost.Service1SoapClient' 不包含 'CookieContainer' 的定义谢谢
解决方案 »
- 聊天室程序状态管理
- 不知道这样的页面前台用什么做比较合适?
- 水晶报表问题,如何把水晶报表导出到本地电脑
- 问哈大牛?
- global.asax异常处理中,response.redirect时偶尔报异常:无法在发送 HTTP 标头之后进行重定向。
- 我在game字段那里写了个link方法, 通过点击获得game字段值值。然后后台程序根据所得值在排序gridview ,但是运行以后点击没有任何反应 ,不知道哪里错了
- profile更新
- 问一下在2.0里,gridview添加列的办法。
- 请教一下asp.net mvc2 下删除服务器文件的问题
- DataList1 高手的问题!
- 求助,伪静态的疑问
- 关于用程序打开RTX的问题
<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
private void Page_Load(object sender, EventArgs e)
{
this.DataGrid1.DataSource = GetProcessInfoAsDataSet();
this.DataGrid1.DataBind();
}private DataSet GetProcessInfoAsDataSet()
{//获取网页上当前正在执行的ASP.NET进程信息
DataSet MyDataSet = new DataSet();
MyDataSet.Tables.Add(new DataTable());
MyDataSet.Tables[0].Columns.Add("ID", typeof(string));
MyDataSet.Tables[0].Columns.Add("Start Time", typeof(string));
MyDataSet.Tables[0].Columns.Add("Age", typeof(string));
MyDataSet.Tables[0].Columns.Add("Request Count", typeof(string));
MyDataSet.Tables[0].Columns.Add("Peak Memory", typeof(string));
ProcessInfo MyInfo = ProcessModelInfo.GetCurrentProcessInfo();
DataRow MyRow = MyDataSet.Tables[0].NewRow();
MyRow["ID"] = MyInfo.ProcessID;
MyRow["Start Time"] = MyInfo.StartTime;
MyRow["Age"] = MyInfo.Age;
MyRow["Request Count"] = MyInfo.RequestCount;
MyRow["Peak Memory"]= MyInfo.PeakMemoryUsed;
MyDataSet.Tables[0].Rows.Add(MyRow);
return MyDataSet;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>演示获取网页上当前正在执行的ASP.NET进程信息</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DataGrid ID="DataGrid1" runat="server">
</asp:DataGrid></div>
</form>
</body>
</html>
[WebMethod(EnableSession = true)], 客服端就可以直接使用COOKIECONTINER了 。 谢谢