代码如下
控制台类型程序using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.IO;namespace ConsoleApplication1
{
class Program : System.Web.UI.Page
{
public static string geta(string key)
{
StreamWriter sw = new StreamWriter("a.txt");
HttpResponse response = new HttpResponse(sw);
HttpRequest request = new HttpRequest("b.txt", "http://localhost:1365/WebSite3/Default.aspx", "");
HttpApplication ha = new HttpApplication();
HttpContext hc = new HttpContext(request, response);
//hc.Application.Add("dfg", "fffff");
return (hc.Application[key] == null).ToString();
} static void Main(string[] args)
{
Console.Write(geta("jack"));
Console.ReadKey();
}
}
}
控制台类型程序using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.IO;namespace ConsoleApplication1
{
class Program : System.Web.UI.Page
{
public static string geta(string key)
{
StreamWriter sw = new StreamWriter("a.txt");
HttpResponse response = new HttpResponse(sw);
HttpRequest request = new HttpRequest("b.txt", "http://localhost:1365/WebSite3/Default.aspx", "");
HttpApplication ha = new HttpApplication();
HttpContext hc = new HttpContext(request, response);
//hc.Application.Add("dfg", "fffff");
return (hc.Application[key] == null).ToString();
} static void Main(string[] args)
{
Console.Write(geta("jack"));
Console.ReadKey();
}
}
}
解决方案 »
- C# 给webbrowser中的控件自动填写值
- 哪位好心的兄弟,能否共享一个MDI应用程序的框架!!!
- datalist 点击事件取值,再传值问题,高手们帮忙看看代码
- 远程连接SQL 2000数据库问题
- 播放器长宽设置问题,在线等,搞定结贴
- c#做的输出到PDF的工具,如果解决中文乱码问题(XtraReports输出PDF中文显示为方格格)?(100分)
- 加班,郁闷!散分!
- NUnit下如何伪造Web的上下文
- vs2008程序下好了 !高手速进!!
- 如何在DataGrid控件的标题行上方显示单元格?(WinForm)
- 求0123456789这10个数任意取6个的所有可能情况,并全部打印出来,20分!
- c# 怎么得到一个进程中开启的多个窗体?
急 啊!
各位高手多帮帮忙
最好 不要 通过 网页