//*********  锁屏DIV ***************************
function LockScreen(tag,title,width,height,url)
{
    if (tag) //锁屏
    {
        var lockdiv = document.getElementById("lockscreen");
        if (lockdiv!=null)
        {
            lockdiv.style.display = "block";
            var subdiv = document.getElementById("subdialog");
            if (subdiv!=null)
            {
                subdiv.style.display = "block";
                document.getElementById("dialog1").src = url;
                     
        }else{
            //创建新的锁屏DIV,并执行锁屏
            var tabframe= document.createElement("div");
            tabframe.id = "lockscreen";
            tabframe.name = "lockscreen";
            tabframe.style.top = '0px';
            tabframe.style.left = '0px';
            tabframe.style.height = '100%';
            tabframe.style.width = '100%';
            tabframe.style.position = "absolute";
            tabframe.style.filter = "Alpha(opacity=10)";
            tabframe.style.backgroundColor="#000000";
            tabframe.style.zIndex = "99998";
            document.body.appendChild(tabframe);
            tabframe.style.display = "block";
            //子DIV
            var subdiv = document.createElement("div");
            subdiv.id = "subdialog";
            subdiv.name = "subdialog";
            subdiv.style.top = Math.round((tabframe.clientHeight-height)/2);
            subdiv.style.left = Math.round((tabframe.clientWidth-width)/2);
            subdiv.style.height = height+'px';
            subdiv.style.width = width+'px';
            subdiv.style.position = "absolute";
            subdiv.style.backgroundColor="red";
            subdiv.style.zIndex = "99999";
            subdiv.style.filter = "Alpha(opacity=100)";
            subdiv.style.border = "1px";
            subdiv.onmousemove = mouseMoveDialog;
            subdiv.onmousedown = control_onmousedown;
            subdiv.onmouseup = mouseUp;
            document.body.appendChild(subdiv);
            subdiv.style.display = "block";
            //subdiv.onclick=UNLockScreen;
            var iframe_height = height-30;
            var titlewidth = width-14;
            var html = "<table border='0' cellpadding='0' cellspacing='0'>"
            html += "<tr><td></td><td>";
            html += "<table><tr><td><font color='#FFFFFF'><b>"+title+"</b></font></td><td style='width:30px' valign='top'><img src='/images/images/close.gif' onclick='UNLockScreen();' style='cursor:hand;'></img></td></tr></table>";
            html += "</td><td></td></tr>";
            html += "<tr><td></td><td style='height:100px;'><iframe id='dialog1' frameborder=0 style='width:"+titlewidth+"px;height:" + iframe_height + "px' src='"+url+"'></iframe></td><td></td></tr>";
            html += "<td></td><td></td><td></td>";
            html += "</table>";
            subdiv.innerHTML = html;
        }
    }else{
        //解屏
        var lockdiv = document.getElementById("lockscreen");
        if (lockdiv!=null)
        {
            lockdiv.style.display = "none";
        }
        var subdiv = document.getElementById("subdialog");
        if (subdiv!=null)
        {
            subdiv.style.display = "none";
        }
    }
}
function UNLockScreen()
{
   LockScreen(false);
}

//调用方法

LockScreen(true,"标题",424,314,http://www.baidu.com);

posted @ 2008-09-27 11:38 C# Coder 阅读(921) 评论(0) 推荐(0) 编辑
摘要: 有同学向我问这个问题,于是就Google了一下找到答案,不过是C下的,我将其改编成了C#的。 当设备被插入/拔出的时候,WINDOWS会向每个窗体发送WM_DEVICECHANGE 消息,当消息的wParam 值等于 DBT_DEVICEARRIVAL 时,表示Media设备被插入并且已经可用;如果wParam值等于DBT_DEVICEREMOVECOMPLETE,表示Media设备已经被移出... 阅读全文
posted @ 2008-08-25 10:22 C# Coder 阅读(929) 评论(0) 推荐(0) 编辑
摘要: 查询速度慢的原因很多,常见如下几种 1、没有索引或者没有用到索引(这是查询慢最常见的问题,是程序设计的缺陷) 2、I/O吞吐量小,形成了瓶颈效应。 3、没有创建计算列导致查询不优化。 4、内存不足 5、网络速度慢 6、查询出的数据量过大(可以采用多次查询,其他的方法降低数据量) 7、锁或者死锁(这也是查询慢最常见的问题,是程序设计的缺陷) 8、sp_lock,sp_who,活动的用... 阅读全文
posted @ 2008-08-11 10:19 C# Coder 阅读(399) 评论(0) 推荐(0) 编辑
摘要: 重载、重写和隐藏的定义: 重载:同一个作用域内发生(比如一个类里面),定义一系列同名方法,但是方法的参数列表不同。这样才能通过传递不同的参数来决定到底调用哪一个。而返回值类型不同是不能构成重载的。 重写:继承时发生,在子类中重新定义父类中的方法,子类中的方法和父类的方法是一样的 例如:基类方法声明为virtual(虚方法),派生类中使用override申明此方法的重写. 隐藏:... 阅读全文
posted @ 2008-08-06 12:57 C# Coder 阅读(2452) 评论(4) 推荐(0) 编辑
摘要: 1.简介 虚函数是C++中用于实现多态(polymorphism)的机制。核心理念就是通过基类访问派生类定义的函数。假设我们有下面的类层次: class A { public: virtual void foo() { cout foo(); // 在这里,a虽然是指向A的指针,但是被调用的函数(foo)却是B的! 这个例子是虚函数的一个典型应用,通过... 阅读全文
posted @ 2008-08-04 11:07 C# Coder 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 只能输入数字:"^[0-9]*$"。 只能输入n位的数字:"^"d{n}$"。 只能输入至少n位的数字:"^"d{n,}$"。 只能输入m~n位的数字:。"^"d{m,n}$" 只能输入零和非零开头的数字:"^(0|[1-9][0-9]*)$"。 只能输入有两位小数的正实数:"^[0-9]+(.[0-9]{2})?$"。 只能输入有1~3位小数的正实数:"^[0-9]+(.[0-9]{1,3})?... 阅读全文
posted @ 2008-08-04 10:12 C# Coder 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 1 新建一个asp.net页面。。内容如下 2 private void Page_Load(object sender, System.EventArgs e) ... 阅读全文
posted @ 2008-07-28 11:07 C# Coder 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 1using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using Sy... 阅读全文
posted @ 2008-07-28 11:03 C# Coder 阅读(1236) 评论(0) 推荐(0) 编辑
摘要: 下载文件 /// /// 下载文件 /// /// private static void DownLoadFile(string filename) { FtpWebRequest re... 阅读全文
posted @ 2008-07-28 10:52 C# Coder 阅读(787) 评论(0) 推荐(0) 编辑
摘要: 在web开发时,有的系统要求同一个用户在同一时间只能登录一次,也就是如果一个用户已经登录了,在退出之前如果再次登录的话需要报错。 常见的处理方法是,在用户登录时,判断此用户是否已经在Application中存在,如果存在就报错,不存在的话就加到Application中(Application是所有Session共有的,整个web应用程序唯一的一个对象): string strUserId... 阅读全文
posted @ 2008-07-25 12:01 C# Coder 阅读(254) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示