Sub ShowMsg(byval msg,byval url) Response.Write("") IF url="" Then Response.Write("") Else Response.Write("") End IF Response.End End Sub
Call ShowMsg("User name is wrong!","index.asp") '跳转到index.asp
Sub ShowMsg(byval msg,byval url) Response.Write("") IF url="" Then Response.Write("") Else Response.Write("") End IF Response.End End Sub
以前在用PJ时就很欣赏WP的永久链接系统,等到自己换成WP后,突然发现我的主机空间不能正常使用WP的永久链接;原因是Windows/IIS主机对PHP程序支持,尤其是.htaccess和Rewrite支持不好,后来找了N多方法后,终于找到了一个比较简单的解决方法。
不需要你懂得IIS下的httpd.ini配置规则,只要复制粘贴即可。
终于受不了WP的诱惑,背叛了PJ,不过现在看来,这实在时太爽了,WP的插件和主题功能很好很强大。虽然俺不懂PHP,但是用起来还是很顺手,只是不能自己开发插件和主题了,囧。
现在的博客访问速度有点慢,原因主要是现在的数据库访问速度不是很好,二是现在的主机对WP支持不好,我想要的自定义链接不行,不支持404.php(支持的时404.asp),最主要的时不支持Rewrite,因此不能将博客缓存。准备换空间。
尽管升级过程中出现了好多错误,但还是OK了,现在正在制作皮肤,呵呵,已经是借用别人的。
所以现在很多地方看起来还是很不好,皮肤目前的Bug还是较多的。
如果各位访客发现有什么bug存在,希望给我留言哈,以后这个皮我准备共享出来的。
29th November update:
音频片段:需要 Adobe Flash Player(9 或以上版本)播放音频片段。 点击这里下载最新版本。您需要开启浏览器的 JavaScript 支持。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | MdiChildForm mdiChildForm=null;//这个是子窗体 TmpChildForm tmpChildForm=null;//这个是临时窗体对象 //自定义子窗体关闭事件 private void tmpChildForm_FormClosed(object sender, FormClosedEventArgs e) { this.tmpChildForm = null; } //自定义子窗体Move事件 private void tmpChildForm_Move(object sender, EventArgs e) { if (tmpChildForm.Left < 0) { tmpChildForm.Left = 0; } if (tmpChildForm.Left > this.Width - tmpChildForm.Width - 15) { tmpChildForm.Left = this.Width - tmpChildForm.Width - 15; } if (tmpChildForm.Top < 0) { tmpChildForm.Top = 0; } if (tmpChildForm.Top > this.Height - tmpChildForm.Height - 65) { tmpChildForm.Top = this.Height - tmpChildForm.Height - 65; } } //父窗体单击事件 private void openMdiChileForm_Click(object sender, EventArgs e) { if (mdiChildForm == null) { mdiChildForm = new MdiChildForm(); mdiChildForm.MdiParent = this; mdiChildForm.Show(); tmpChildForm = mdiChildForm; mdiChildForm.Move += new EventHandler(tmpChildForm_Move); mdiChildForm.FormClosed += new FormClosedEventHandler(tmpChildForm_FormClosed); } else { mdiChildForm.Activate(); } } |
将此代码添加到父窗体cs中即可,代码中的两个数字根据实际情况改变。
如果有多个子窗体,只需要按照openMdiChileForm_Click事件调用即可。
隐藏父窗体滚动条的方法详见:http://imwls.com/article.asp?id=44
最近在找怎么不让子窗体超过MdiParent范围,但是一直没有找到好的方法。
最后找了个折中的办法,都是禁止那丑陋的滚动条出现的。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | private const int SB_BOTH = 3; private const int WM_NCCALCSIZE = 0x83; [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern int ShowScrollBar(IntPtr hWnd, int wBar, int bShow); protected override void WndProc(ref Message m) { if (mdiClient != null) { ShowScrollBar(mdiClient.Handle, SB_BOTH, 0); } base.WndProc(ref m); } MdiClient mdiClient = null; private void FormMain_Load(object sender, EventArgs e) { foreach (Control c in this.Controls) { if (c is MdiClient) { mdiClient = c as MdiClient; } } } |