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

c# 验证码组件 可vb,asp,net调用

      今天公司要求用C#写个验证码组件,让asp可以调用,在网上找了一堆资料,终于给我给搞出来了,因为本人第一次写组件,也是第一次发表文章,所有可能说的不是很好,大家请见谅。
      csdn上有这么篇文章,想学习写组件的可以去看看:http://blog.csdn.net/KimmKing/archive/2008/12/04/3445233.aspx,因为本人就是仿照这个写的验证码组件,因为怕上面的文章丢失,我就在这里简单说下创建的过程:
1、创建一类库
2、实现一个类(具体代码下面详写)
3、给文件签名
方法:选择开始菜单中Vistual Studio目录下的Vistual Studio Tools下的Vistual Studio 命令提示。使用sn -k c:\myKey.snk生成签名文件。在项目上右键,点击属性,选择签名,选中为程序集签名,选择myKey.snk文件。
 
4、生成解决方案
 在项目目录的\TestCom\bin\Debug中可以找到TestCom.dll
5、生成tlb类库
在Visual Studio命令提示符下,切换到此目录。
输入tlbexp TestCom.dll /out:TestCom.tlb
6、注册类型库
输入regasm TestCom.dll /tlb: TestCom.tlb /codebase,将类型库导入到注册表。提示成功注册了类型,说明操作成功,此时TestCom .dll可以作为一个com来使用。
7、添加dll到GAC
输入gacutil /i TestCom.dll,将此.net程序集添加到GAC。
这样创建组件的所有工作就完成了。剩下的就是调用了
在vb和net里面调用:导入dll,实例化对象就可以使用了
(Dim a As New TestCom.Class1)a.方法
(TestCom.Class1 aa = new TestCom.Class1())aa.方法
在asp调用:
<%
SET s = CreateObject("TestCom.Class1")
s.test()
%>
 
以上就是我找到的创建组件的资料,那么现在就开始编写验证码组件的代码吧
首先编写类库:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Security;
namespace TestComs
{
[ComVisible(true)]
public interface iClass1
{
string DoCode(int num);
byte[] DoImg(string code);
}
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
public class Class1 : iClass1
{
private double PI2;
public Class1()
{
PI2 = 6.


相关文档:

VB窗口全屏与置顶

全屏
Private Sub Form_Load()
    Me.Width = Screen.Width
    Me.Height = Screen.Height
    Me.WindowState = 2
End Sub
置顶
1.在VB的通用代码里写入API声明
Private Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, _
  &n ......

asp无法正常显示报表内容问题解决

开发环境:VS2008
WEB服务器:IIS7.0
为何在调试时,可正常显示报表内容,可生成后,运行时,只显示报表框架,并不能正常显示报表内容.
我把浏览器所有限制选项都取消了,还是一样的问题,不知为何.正在寻找答案................... ......

风渡科技ASP网上购物系统

软件名称:风渡科技ASP网上购物系统  v0912-26
 
软件大小:7069k
 
运行环境:ASP/Access
 
软件类别:电子商务
 
软件授权:免费
 
开发商家: 风渡科技
 
官方网站:http://www.chinammc.com
 
演示地址:http://demo01.chinammc.com
 
下载地址: http://w ......

用VB画4个点的NURBS曲线参考代码

Dim p(10000, 1) As Double
Dim num As Integer
Dim ptx As Single
Dim pty As Single
Dim w0, w1, w2, w3 As Single
Private Sub Command1_Click()
Dim t As Single
 Dim i As Integer
 Dim f0, f1, f2, f3 As Single
 Picture1.DrawWidth = 3
      For t = 0 To 1 St ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号