Browse Source

配置统计放到Config目录

master
yibo 7 years ago
parent
commit
05a86b2640
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      WinFormControl/Utils/XmlUtil.cs

+ 3
- 3
WinFormControl/Utils/XmlUtil.cs View File

@ -10,10 +10,10 @@ namespace WinFormControl
{
internal static class XmlUtil
{
static string currentPath = Directory.GetCurrentDirectory();
static string config = "Config";
public static void SerializerObjToFile(object obj, string fileName)
{
fileName = Path.Combine(currentPath, fileName + ".xml");
fileName = Path.Combine(config, fileName + ".xml");
var ser = new XmlSerializer(obj.GetType());
using (var stream = File.Open(fileName, FileMode.Create))
{
@ -24,7 +24,7 @@ namespace WinFormControl
public static T DeserializeFromFile<T>(string fileName)
where T : new()
{
fileName = Path.Combine(currentPath, fileName + ".xml");
fileName = Path.Combine(config, fileName + ".xml");
if (!File.Exists(fileName))
{
return new T();


Loading…
Cancel
Save