1
我注意到GitHub for windows,報告了一些我認爲不應該改變的文件。 這個問題與我們的應用程序中讀取的一些.txt文件有關。運行程序後,所有讀取.TXT的報導具有每行結束了一倍: 如:StreamReader是否改變我的行結束符?
Line1
Line2
成爲
Line1
Line2
我有一種感覺,這是做了一些行結束髮行,並可能在git中設置錯誤,所以我查看了Notepad ++顯示的所有字符。在運行程序之前這些文件是這樣的:
Line1 CRLF
Line2 CRLF
Line3
,後,他們成爲:
Line1 CR
CRLF
Line2 CR
CRLF
Line3
如此看來GH4W在報告這些改變是正確的。麻煩的是,他們不應該。 我讀他們有這樣一個StreamReader:
// ASCII.RodBarcodes holds path to RodBarcodes.txt
using (StreamReader sr = new StreamReader(ASCII.RodBarcodes))
{
int count = 0;
string line = sr.ReadLine();
while (line != null)
{
Rods.Add(new AnemometerRod());
Rods[count].Barcode = line;
line = sr.ReadLine();
count++;
}
}
在哪裏這些額外CR是從哪裏來的?