Home > Net >  C # to do desktop application error, can't find the problem???????
C # to do desktop application error, can't find the problem???????

Time:09-28

The namespace FruitConsignmentManager. Power
{
Using FruitConsignmentManager. The Module;
using System;
using System.Collections.Generic;
using System.IO;
Using System. The Reflection;
using System.Xml;



Public class PowerManager
{
Private static Dictionary _cache=new Dictionary (a);

Public static List ReadPowerConfig (string formName)
{
List list;
_cache. TryGetValue (formName, out list);
If (list==null)
{
List=new List (a);
List List2=readPowerXML ();
Foreach (PowersData data in list2)
{
If (data. CFormName. The Trim () ToLower ()==formName. The Trim () ToLower ())
{
List. The Add (data);
}
}
_cache. Add (formName, a list);
}
return list;
}

Public static List ReadPowerGroupConfigByXML ()
{
List List=new List (a);
Stream manifestResourceStream=Assembly. GetExecutingAssembly (.) GetManifestResourceStream (" FruitConsignmentManager. Power. PowerGroupConfig. XML ");
XmlDocument document=new XmlDocument ();
Document. The Load (manifestResourceStream);
XmlNode firstChild=document. FirstChild;
for (int i=0; i {
XmlNode 2=firstChild..childnodes [I];
Foreach (object obj2 in 2..childnodes)
{
XmlNode node3=obj2 as XmlNode;
PowerGroupData item=new PowerGroupData {
CGroupName=2. The Attributes [r]. "Name" Value,
CFormName=node3. Attributes [r]. "Name" Value
};
List. The Add (item);
}
}
return list;
}

Private static List ReadPowerXML ()
{
List List=new List (a);
Stream manifestResourceStream=Assembly. GetExecutingAssembly (.) GetManifestResourceStream (" FruitConsignmentManager. Power. PowerConfig. XML ");
XmlDocument document=new XmlDocument ();
Document. The Load (manifestResourceStream);
XmlNode firstChild=document. FirstChild;
for (int i=0; i {
XmlNode 2=firstChild..childnodes [I];
Foreach (object obj2 in 2..childnodes)
{
XmlNode node3=obj2 as XmlNode;
PowersData item=new PowersData {
CFormName=2. The Attributes [r]. "Name" Value,
CFormText=2. The Attributes [r]. "HeadText" Value,
CControlName=node3. Attributes [r]. "Name" Value,
CControlText=node3. Attributes [r]. "HeadText" Value,
CPower=node3. Attributes [r]. "Power" Value
};
List. The Add (item);
}
}
return list;
}
}
}

Error messages below

CodePudding user response:

http://www.cnblogs.com/alexis/archive/2010/11/06/1870519.html

CodePudding user response:

Where have images as shown in figure,,,,,

CodePudding user response:

You should explain where is wrong? At the very least debugged throw exceptions to come out?

Don't you let the person with the naked eye to see so many code?

Or copy your code to the project in the actual operation?

Everyone is busy...
  •  Tags:  
  • C#
  • Related