• 大小: 79KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-07
  • 语言: C#
  • 标签: JS  c#  DLL  COM  源代码  

资源简介

JS调用c#编写的DLL 源代码 包含c#新建类库,生成DLL,以及DLL的注册 ,JS调用DLL的两种方法的整个过程。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace DllCOMDemo
{
    //[Guid(“ED1162B4-B166-454B-B8D8-7CE043561EC5“)]
    //public class Class1
    //{

    //}

    [Guid(“369588B3-0AC7-43fb-AB02-D92E9AC744AC“)]
    public interface IDemo
    {
        string Name { get; set; }
        string Gender { get; set; }
        DateTime Birthday { get; set; }
        int GetAge();
        string GetManInformation();
    }

    [Guid(“437081BB-3023-49e7-9461-55326F08C44E“)]
    public class Demo : IDemo
    {
        string name = “华骨龙“;
        string gender = “男“;
        DateTime birthday = new DateTime(1987 2 8);

        public string Name { get { return this.name; } set { this.name = value; } }
        public string Gender { get { return this.gender; } set { this.gender = value; } }
        public DateTime Birthday { get { return this.birthday; } set { this.birthday = value; } }

        public int GetAge() { return DateTime.Now.Year - this.Birthday.Year; }
        public string GetManInformation()
        {
            return string.Format(“姓名:{0};年龄:{1};性别:{2};生日:{3}“ Name GetAge() Gender Birthday);
        }
        public string SayHello(string name) { return “【Message from C# DLL】Hello “ + name; }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5632  2013-06-05 09:59  WebApplication1\DllCOMDemo\bin\Debug\DllCOMDemo.dll

     文件      13824  2013-06-05 09:59  WebApplication1\DllCOMDemo\bin\Debug\DllCOMDemo.pdb

     文件       2432  2013-06-05 09:59  WebApplication1\DllCOMDemo\bin\Debug\DllCOMDemo.tlb

     文件       1392  2013-06-05 09:59  WebApplication1\DllCOMDemo\Class1.cs

     文件       2365  2013-06-05 09:49  WebApplication1\DllCOMDemo\DllCOMDemo.csproj

     文件       5681  2013-06-05 09:59  WebApplication1\DllCOMDemo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        622  2013-06-05 09:49  WebApplication1\DllCOMDemo\obj\Debug\DllCOMDemo.csproj.FileListAbsolute.txt

     文件       5632  2013-06-05 09:59  WebApplication1\DllCOMDemo\obj\Debug\DllCOMDemo.dll

     文件      13824  2013-06-05 09:59  WebApplication1\DllCOMDemo\obj\Debug\DllCOMDemo.pdb

     文件        605  2013-06-05 09:59  WebApplication1\DllCOMDemo\obj\DllCOMDemo.csproj.UnmanagedRegistration.cache

     文件       1375  2013-06-05 09:49  WebApplication1\DllCOMDemo\Properties\AssemblyInfo.cs

     文件       4608  2013-06-03 14:21  WebApplication1\JSLib\bin\Debug\JSLib.dll

     文件      11776  2013-06-03 14:21  WebApplication1\JSLib\bin\Debug\JSLib.pdb

     文件         49  2010-06-19 20:53  WebApplication1\JSLib\Jscript1.js

     文件       4297  2013-06-01 09:42  WebApplication1\JSLib\JSLib.csproj

     文件        451  2013-06-01 09:42  WebApplication1\JSLib\JSLib.csproj.user

     文件       5665  2013-06-03 14:21  WebApplication1\JSLib\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        947  2013-06-03 14:21  WebApplication1\JSLib\obj\Debug\JSLib.csproj.FileListAbsolute.txt

     文件       4608  2013-06-03 14:21  WebApplication1\JSLib\obj\Debug\JSLib.dll

     文件      11776  2013-06-03 14:21  WebApplication1\JSLib\obj\Debug\JSLib.pdb

     文件       1439  2010-06-19 20:53  WebApplication1\JSLib\Properties\AssemblyInfo.cs

     文件        591  2010-06-19 20:53  WebApplication1\JSLib\ReferenceClientscript.cs

     文件       3923  2010-06-19 21:12  WebApplication1\readme.txt

     文件       1483  2013-06-01 09:42  WebApplication1\UpgradeLog.xml

     文件       4608  2013-06-03 14:21  WebApplication1\WebApplication1\bin\JSLib.dll

     文件      11776  2013-06-03 14:21  WebApplication1\WebApplication1\bin\JSLib.pdb

     文件       4608  2013-06-05 10:04  WebApplication1\WebApplication1\bin\WebApplication1.dll

     文件      13824  2013-06-05 10:04  WebApplication1\WebApplication1\bin\WebApplication1.pdb

     文件       1562  2013-06-05 10:39  WebApplication1\WebApplication1\Default.aspx

     文件        510  2010-06-19 19:46  WebApplication1\WebApplication1\Default.aspx.cs

............此处省略48个文件信息

评论

共有 条评论