日期:2014-05-19  浏览次数:20797 次

弱弱的问个问题,谢谢!
FileStream.Seek(pos,   SeekOrigin.End);请问在c#中这句话是什么意思啊?也就是返回的文件流的位置是如何确定的,谢谢!

------解决方案--------------------
public static void StringToFile(string sFilePath, string sString)
{
FileStream outFile;
byte[] binaryData;
binaryData = System.Convert.FromBase64String(sString);
outFile = new FileStream(sFilePath,FileMode.Create,FileAccess.Write);
outFile.Write(binaryData, 0, binaryData.Length);
outFile.Close();
}

public static string FileToString(string sFilePath)
{
FileStream inFile;
byte[] binaryData;
inFile = new FileStream(sFilePath,FileMode.Open,FileAccess.Read);
binaryData = new Byte[inFile.Length];
long bytesRead = inFile.Read(binaryData, 0,(int)inFile.Length);
inFile.Close();
return System.Convert.ToBase64String(binaryData, 0,binaryData.Length);
}

应该能看懂得吧^0^