C#生成com组件,供asp调用
C#生成com组件,供asp调用
一、vs2005—新建项目—C#类库
类库源码如下(包含接口,类,事件接口):
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data.SqlClient;
using System.Runtime.InteropServices;
namespace entryclass
{
//Guid值的产生:Program FilesMicrosoft Visual Studio 8Common7Toolsguidgen.exe,运行它,选中单选4,点“New Guid”,点“Copy”,进入类库,粘贴即可
//类接口
[Guid("F2257E71-ECC9-47ef-A065-F5B530F24B07")]
public interface ini_mng_Interface
{
[DispId(1)] //固定写法,索引号从1开始
string ini_dme(string entryuser, string entrypass, string agentname, string agentpass, string constr);
[DispId(2)]
string ini_svr(string entryuser, string entrypass, string agentname, string agentpass, string constr);
}
// 事件接口
[Guid("45875EE5-5C8D-4016-897A-FCC7DD5A6834"), //固定写法
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ini_mng_Events
{
}
//类
[Guid("8EDFA9EA-9589-4157-AEEF-AB4861EFE5D6"), //固定写法
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(hst_odr_Events))]
public class ini_mng : ini_mn
相关文档:
Introduction
This article is about passing data between VB.NET/C# WinForms and JavaScript.
Before reading further, let me warn you that this article is not about ASP.NET. Concepts covered in the article are applied to Desktop applications.
Background
I was working on a project which required dat ......
1 类似xmlns=""的文件
示例XML文件:
<?xml version="1.0" encoding="UTF-8"?>
<WebSrvMessage xmlns="http://www.lenoval.com/">
<version>1.0</version>
<DataContent>
<DateTag>2010-5-17</DateTag>
</DataCont ......
首先申明:这个是我转载的,致力于为像我一样的新手提供帮助!
1、IIS下301设置 Internet信息服务管理器 -> 虚拟目录 -> 重定向到URL,输入需要转向的目标URL,并选择“资源的永久重定向”。
2、ASP下的301转向代码
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanent ......
在web程序中,经常会使用在一个网页使用其他网页提交的数据信息,这里可以使用Request内置对象来完成,来获取用户提交的信息,根据客户端提交数据方式的不同,Request对象分别使用Form和QueryString集合属性来获取数据。下面是两种集合获取方式的不同点:通过Form获取数据时在form属性中简单的添加action=“跳转的网页 ......
asp.net(c#)网页跳转七种方法小结
发布时间:2009-11-25 11:13:03
1.Response.Redirect("http://www.yayiba.com",false);
目标页面和原页面可以在2个服务器上,可输入网址或相对路径。后面的bool值为是否停止执行当前页。
跳转向新的页面,原窗口被代替。"
浏览器中的URL为新路径。
:Response.Redirect方 ......