-------------------------------stream转string-------------------------------
FileStream fstPreview = new FileStream(stPath, FileMode.Open, FileAccess.Read, FileShare.Read);
StreamReader srdPreview = new StreamReader(ss);
String temp = string.Empty;
while (srdPreview.Peek() > -1)
{
String input = srdPreview.ReadLine();
temp += input;
StreamReader srdPreview = new StreamReader(ss);
String temp = string.Empty;
while (srdPreview.Peek() > -1)
{
String input = srdPreview.ReadLine();
temp += input;
}
srdPreview.Close();
return temp ;
srdPreview.Close();
return temp ;
-------------------------------string转stream-------------------------------
Stream s = new MemoryStream(ASCIIEncoding.Default.GetBytes("Test String"));