本文介绍了C#GetType for FIleType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

列表与LT; billingfileformatter> formatters = BillingFileManager.GetFormatterByIdWithChilden((Guid)QueueInfo.BillingFileFormatterId);

foreach(格式化程序中的BillingFileFormatter格式化程序)

{

List< string> LineItemList = new List< string>();

ACH testobject = new ACH();

// string typeName =Billing.Ach。 + formatter.ClassName +,Billing.Ach,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null;

string typeName = formatter.ClassName;

类型filetype = Type.GetType(typeName);

IBillingFile billingFile =(IBillingFile)Activator.CreateInstance(filetype);

LineItemList = billingFile.ProcessBillingQueue(QueueInfo,new List< order> ;(OrdersToProcess.Values.ToList()));

List<billingfileformatter> formatters = BillingFileManager.GetFormatterByIdWithChilden((Guid)QueueInfo.BillingFileFormatterId);
foreach (BillingFileFormatter formatter in formatters)
{
List<string> LineItemList = new List<string>();
ACH testobject = new ACH();
//string typeName = "Billing.Ach." + formatter.ClassName + ", Billing.Ach, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
string typeName = formatter.ClassName;
Type filetype = Type.GetType(typeName);
IBillingFile billingFile = (IBillingFile)Activator.CreateInstance(filetype);
LineItemList = billingFile.ProcessBillingQueue(QueueInfo, new List<order>(OrdersToProcess.Values.ToList()));








上面是我失败的代码,GetType返回null,我不知道为什么。任何帮助将不胜感激。




Above is the code that is failing for me, the GetType is coming back null and I dont know why. Any help would be appreciated.

推荐答案



这篇关于C#GetType for FIleType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 23:58