惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
爱范儿
爱范儿
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
有赞技术团队
有赞技术团队
博客园_首页
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
V
Visual Studio Blog
Jina AI
Jina AI
博客园 - Franky
量子位
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence

博客园 - joinsky

asp.net下载代码 - joinsky - 博客园 必须会的十种语言 df 有关程序员的传说 网站标准 asp.net中的DES加密 ASp.net中的定位问题. - joinsky - 博客园 文字的竖排与横排 - joinsky - 博客园 两个常用的存储过程(转) iframe自适应网页内容的高度 - joinsky - 博客园 IErrorInfo.GetDescription 因 E_FAIL(0x80004005) 而失败 javascript中object转换为string 数据库中游标的使用.....用于循环 网页技巧之如何隐藏状态栏里出现的LINK信息 随页面滚动的层(转) 页面过长自动进行分页(转) 自定义组件的执行周期(转) vs2003问题集锦 HTTP/1.1 500 Internal Server Error 解决方法
调用DLL中的方法(转)
joinsky · 2006-06-12 · via 博客园 - joinsky

我写个了小sample

1.cs

using System;

public class MyClass
{
   public static string GetStr()
   {
      return "this is a sample.. haha i am Taye";
   }
}

在cmd中
csc /t:library 1.cs

生成了1.dll


2.cs
using System;

public class MyClass2
{
   public static void Main()
   {
      Console.WriteLine(MyClass.GetStr());
   }
}

在cmd中
csc /t:exe 2.cs /r:1.dll
生成了2.exe

2.cs中使用了1.dll中的MyClss.GetStr()的一个静态方法。所以在编译时要先引用
/r:1.dll