class Algo
{
public const long AlgorithmDescription = 1611048;
public const long AlgorithmFamilyCodeSequence = 6684719;
public const long AlgorithmName = 6684726;
public const long AlgorithmNameCodeSequence = 6684720;
public const long AlgorithmParameters = 6684722;
public const long AlgorithmType = 1611047;
public const long AlgorithmVersion = 6684721;
}
class Class1<T>
{
SortedList<uint, string> ds;
public SortedList<uint, string> TraverseTag()
{
ds = new SortedList<uint, string>();
uint i = 0;
foreach (FieldInfo prop in typeof(Algo).GetFields(BindingFlags.Public |
BindingFlags.Static |
BindingFlags.Instance))
{
ds.Add(i, prop.Name);
i++;
}
return ds;
}
}
public class Program
{
public static void Main()
{
var objClass = new Class1();
SortedList<uint, string> s = objClass.TraverseTag();
}
}
从Algo
类中,我为此创建了一个 dll 并使用对我的Program.cs
类的引用并调用该TraverseTag()
方法,该方法返回我 uint 和 FieldInfo 它返回我{[0,AlgorithmDescription]}
,但我还想要分配给我的Algo
类中的数据成员的值。
例如>
{[0,算法描述,1611048]}