System.IO.IsolatedStorage.IsolatedStorageFile.Dispose C# (CSharp) Method

Dispose() public method

public Dispose ( ) : void
return void
        public void Dispose() { }
        public bool FileExists(string path) { throw null; }

Usage Example

Esempio n. 1
0
 /// <summary>
 /// 读取本地文件信息,SilverLight缓存中
 /// </summary>
 /// <param name="rFileName">存储文件名</param>
 /// <returns>返回文件数据</returns>
 public static byte[] ReadSlByteFile(string rFileName)
 {
     System.IO.IsolatedStorage.IsolatedStorageFile isf = null;
     System.IO.Stream stream = null;
     byte[]           buffer = null;
     try
     {
         isf = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication();
         if (!isf.FileExists(rFileName))
         {
             return(null);
         }
         stream = new System.IO.IsolatedStorage.IsolatedStorageFileStream(rFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read, isf);
         buffer = new byte[stream.Length];
         stream.Read(buffer, 0, (int)stream.Length);
     }
     finally
     {
         if (stream != null)
         {
             stream.Close(); // Close the stream
             stream.Dispose();
         }
         isf.Dispose();
     }
     return(buffer);
 }
All Usage Examples Of System.IO.IsolatedStorage.IsolatedStorageFile::Dispose