zoukankan      html  css  js  c++  java
  • c sharp dll

    1. generate dll

    building .cs file, for example: myDll.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    namespace DZTT
    {
        public class Operate
        {
            public int getSum(int a, int b)
            {
                return a + b;
            }
        }
    }
    View Code

    enter vs menu->cmd

    csc /target:library /out:myDll.DLL myDll.cs

    2. building console project testDll

    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Text; 
    using DZTT; 
    namespace TestDll 
    { 
    class Program 
    { 
    static void Main(string[] args) 
    { 
    Operate operate = new Operate(); 
    int c = operate.getSum(10 ,20); 
    Console.WriteLine(c.ToString()); 
    } 
    } 
    } 
    View Code

    3. Project->Add reference, add myDll.dll

    ok.

  • 相关阅读:
    RedisPlugin
    微信、支付宝授权与支付
    在手机上预览h5项目
    localStorage
    fluter中json的处理
    flutter路由
    一个类实现多个接口
    抽象类、接口
    dart中的类
    方法
  • 原文地址:https://www.cnblogs.com/https/p/9642884.html
Copyright © 2011-2022 走看看