我在vs2005中做了一个dll文件,想在以后的程序中调用,代码如下using System;
using System.Web;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Security;
using System.Security.Cryptography;
using System.Resources;
using System.Data.SqlClient;
using System.Data.OleDb;namespace DefaultDll
{
public class DefaultDll
{
#region lefttext string lefttext(int leftnum, string lefttext)
{
string temptext;
if (lefttext.Length > leftnum)
{
temptext = lefttext.Substring(0, (leftnum - 3)) + "...";
}
else
{
temptext = lefttext;
}
return (temptext);
}
#endregion
}
}
可是我在其他cs文件中使用不了。。DefaultDll.Defaualt.Dll.lefttext 没有这个函数,不知道是不是我需要在cs中声明一下?或者需要在上面的程序里面写什么东西谢谢
using System.Web;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Security;
using System.Security.Cryptography;
using System.Resources;
using System.Data.SqlClient;
using System.Data.OleDb;namespace DefaultDll
{
public class DefaultDll
{
#region lefttext string lefttext(int leftnum, string lefttext)
{
string temptext;
if (lefttext.Length > leftnum)
{
temptext = lefttext.Substring(0, (leftnum - 3)) + "...";
}
else
{
temptext = lefttext;
}
return (temptext);
}
#endregion
}
}
可是我在其他cs文件中使用不了。。DefaultDll.Defaualt.Dll.lefttext 没有这个函数,不知道是不是我需要在cs中声明一下?或者需要在上面的程序里面写什么东西谢谢
public shared
改成
public string lefttext