路漫漫,求索不息

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 private string ReadConfigContent(string path)
    {
        string configString = "";
        FileInfo configFile = new FileInfo(path);
        if (!configFile.Exists)
        {
            throw new Exception("SOA配置文件不存在");
        }
        using (StreamReader reader = configFile.OpenText())
        {
            configString = reader.ReadToEnd();
        }
        if (string.IsNullOrWhiteSpace(configString))
        {
            throw new Exception("配置文件内容为空");
        }
        return configString;
    }

posted on 2013-06-17 16:02  路漫漫,求索不息  阅读(170)  评论(0编辑  收藏  举报