C#使用Encoding.UTF8附加文本

时间:2017-04-24 09:52:51

标签: c# csv utf-8

我有这段代码:

 using (var sw = new StreamWriter(path + kat + "/" + namec, false, Encoding.UTF8))
                            {
                                sw.WriteLine(namex + "," + address + "," + web + "," + email + "," + phone  + "," + linksx + "," + transport);
                            }

如何附加文字并包含Encoding.UTF8?

我试过了:

 using (StreamWriter sw = File.AppendText(path + kat + "/" + namec, false, Encoding.UTF8))

但我得到了这个:

  

严重级代码描述项目文件行抑制状态   错误CS1501方法'AppendText'没有超载需要3   参数visitdenmark C:\ Users \ ??? \ Documents \ Visual Studio   2015 \ Projects \ visitdenmark \ visitdenmark \ Form1.cs 193 Active

1 个答案:

答案 0 :(得分:0)

实际上错误信息是正确的。声称.controller(function($scope, $location, $anchorScroll) { $scope.gotoBottom = function() { // set the location.hash to the id of // the element you wish to scroll to. $location.hash('bottom'); // call $anchorScroll() $anchorScroll(); }; }) 没有3个参数。

但在我的意见中,没有必要将AppendText置于第一种方法之外。但是为了附加文本,您应该将第二个参数更改为StreamWriter

true