Google [站内搜索]

分类: Web编程预览模式: 普通 | 列表

让ASP也支持动态include文件

一直觉得ASP的include非常的别扭,一是它不能放在"<%"和"%>"之间,感觉很独特,很格格不入,二是它不能像PHP的include那样可以动态的随意包含文件!以前也有人试图解决过这个问题,但总是不尽完美,今天在pscode.com又看到有人写了个类来解决这个问题,可以说它是在我所见过的解决方法中最好的了。由于原类中存在一些不足,我稍做了修改,下边为修改后的代码:

<%
public include, include_vars
set include = new cls_include

查看更多...

分类:Web编程 | 固定链接 | 评论: 2 | 引用: 0 | 查看次数: 6163
<asp:Button ID="Button1" runat="server" Text="下一步" OnClientClick="return CheckForm1(document.form1);" PostBackUrl="http://www.mzwu.com/send.aspx" />

运行后页面源代码如下:

<input type="submit" name="Button1" value="下一步" onclick="return CheckForm1(document.form1);WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button1", "", false, "", "http://www.mzwu.com/send.aspx", false, false))" id="Button1" />

可见"return CheckForm1(document.form1);"后背后的脚本根本就不再执行了,所以PostBackUrl也就失去了作用,解决方法是不使用PostBackUrl,在脚本CheckForm1动态改变表单的action属性的。

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7356
<%@ Page Language="VB" %>
<%@ import Namespace="System.IO" %>
<%@ import Namespace="System.Net" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7807

Register protocol

A protocol is a method that is used to send, receive, and handle information over a connection. Common protocols viewed from the browser include http, https, ftp, and mailto. In order for you to view information sent over a specific protocol, it must be registered. If you enter a URL for an unknown protocol (foo) in the Location Bar, you will receive a message such as, Firefox doesn't know how to open this address, because the protocol (foo) isn't associated with any program or, in Mozilla Suite/SeaMonkey, foo not a registered protocol.

Once registered, the protocol can then be handled by the program you specify, such as your browser or a third party viewer. This means that a hyperlink ( e.g. foo://fred) can use the handler for protocol foo to open the file named fred.

Windows

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7858

[翻译] 将应用程序注册为URL协议

The About Asynchronous Pluggable Protocols article describes how to develop handlers for new protocols. In some cases, it may be desirable to invoke another application to handle a custom protocol. To do so, register the existing application as a URL Protocol handler. Once the application has successfully launched, it can use command-line parameters to retrieve the URL that launched it.
文章《About Asynchronous Pluggable Protocols》(中译[翻译]关于“异步可插协议”(About Asynchronous Pluggable Protocols(APPs)))描述了如何为一个新的协议开发处理程序(处理器handlers)。在一些案例中,可能会描述如何调用另外一个应用程序来处理自定义协议(custom protocol)。注册已经存在的应用程序为一个URL协议处理器即可。一旦应用程序被成功地启动,我们可以使用命令行参数来重新找回URL来启动它。

·Registering the Application Handling the Custom Protocol
·Launching the Handling Application

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 8557

C#使用XMLHTTP获得网页源代码

using System;
using MSXML2;//引用COM:Microsoft XML, v3.0

namespace ConsoleApplication1
{

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6228

[私密日志] 私密日志

该日志是私密日志,只有博主或发布者可以查看!
分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1669

ASP获取图片的高度和宽度

<%
Class Image
    Private oStream
    Public ImgW,ImgH
    

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7993

C#图像处理类

使用此类可实现生成缩略图、漫射效果、棕褐色调 (老照片)效果、锐化效果、黑白效果和灰度效果。

/// <summary>
/// 图像处理类,需引用System.IO和System.Drawing
/// </summary>

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6065

C#常用自定义类型转换函数

/// <summary>
/// 将字符型类型转换为整型值
/// </summary>
/// <param name="objValue">字符型</param>
/// <param name="defaultValue">无法转换时的默认值</param>

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7555