易截截图软件、单文件、免安装、纯绿色、仅160KB

C#清除页面缓存

C#清除页面缓存
    private void SetPageNoCache()
        {
            Response.Buffer = true;
            Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            Response.AddHeader("Pragma", "No-Cache");
        }
    (1)   Response.Buffer = true;
            Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            Response.AddHeader("Pragma", "No-Cache");
    (2) HTML方法
        <meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
    (3) 重新调用原页面的时候在给页面传一个参数:    href="****.aspx?random()"


相关文档:

C#中ref参数与out参数的区别

先贴代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ref_and_Out_test
{
    class Program
    {
        static void Main(string[] args)
      & ......

C#入门

变量、常量及表达式变量和常量变量(静态、非静态、数组元素、值参数、引用参数、输出参数、局部变量)静态(static) 如 public static int x;  一旦静态变量所属的类被装载,直到包含该类的程序运行结束时它一直存在。非静态:不带有static修饰符声明的变量称为实例变量,如int a ;常量(attributes constnt-modifiers CO ......

浅析工厂模式(C#)

我以为,在所有模式中,最简单、最常用的就是工厂模式了(包括抽象工厂)。
工厂模式和抽象模式的区别在于,工厂模式是通过参数(一般叫型别码)来动态生成对象,而抽象工厂必须了解上下文才能调用相应的对象。实例代码如下:
一、工厂模式
public class Factory
{
public static object Create(int type)
{ ......

C#扫描计算机端口

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace PortScanner
{
class Program
{
 //已扫描端口数目
 internal static int scannedCount = 0;
 //正在运行的线程数目
 internal static int ru ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号