Systen,IO

        private void CreateHtml(string sPath, string txt)
        {
            string currPath = @"C:\MyCodeHelper" + sPath;
            FileInfo fi = new FileInfo(currPath);
            var di = fi.Directory;
            if (!di.Exists)
                di.Create();


            using (StreamWriter s = File.CreateText(currPath))
            {
                s.Write(txt);
            }
        }

  

posted @ 2018-01-12 23:46  少时不知贵  阅读(169)  评论(0编辑  收藏  举报