如何在Windows应用程序中使用Response.Clear()

问题描述:

朋友,

谁能建议我,Response.clear()需要使用的所有命名空间和C#编码是什么.

我正在使用使用C#编码的Windows应用程序.

现在,我收到错误消息"名称" Response"在当前上下文中不存在",所以有什么可以帮助我解决此错误的问题.

我用来将少量数据下载到文件中的提及编码.

Hi Friends,

Can any one suggest me, what are all Namespace and C# coding that we need to use for Response.clear().

I am using Windows Application using C# coding.

Now I am getting the error "The name ''Response'' does not exist in the current context", so can any help me fix this error .

The Mentioned Coding that i am Using to download few data''s into a file .

Response.Clear();
           Response.Buffer = true;
           Response.AddHeader("content-disposition","attachment;filename=OutPut"+ System.DateTime.Now+ ".csv");
           Response.Charset = "";
           Response.ContentType = "application/text";





Response.Output.Write(dt.ToString());
            Response.Flush();
            Response.End();

我希望请求和响应"只能在Web开发中使用.请告诉我在寡妇中使用Response.clear()的原因.
I hope that Request and Response can be used only in web development. Please tell me the reason for using Response.clear() in widows..


检查这些

从Web下载文件[C#] [ MyDownloader:多线程C#分段下载管理器 [文件列表下载器 [
Check these

Download Files from Web [C#][^]
MyDownloader: A Multi-thread C# Segmented Download Manager[^]
File List Downloader[^]


这意味着您尚未在方法中定义Response或类,否则无法在任何可用的命名空间中对变量的定义进行优化.

可能是您需要传递一个参数,但是由于我们不知道您的代码是什么样子,因此无法确定.
It means that you haven''t defined Response within the method or class, and it can''t otherwise fine a definition for the variable in any of the available namespaces.

Chances are that you need to pass a parameter, but it''s impossible to tell because we don''t know what your code looks like.