System.IO.IsolatedStorage.IsolatedStorageFileStream.BeginWrite C# (CSharp) Méthode

BeginWrite() public méthode

public BeginWrite ( byte buffer, int offset, int numBytes, System userCallback, object stateObject ) : System.IAsyncResult
buffer byte
offset int
numBytes int
userCallback System
stateObject object
Résultat System.IAsyncResult
        public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int numBytes, System.AsyncCallback userCallback, object stateObject) { throw null; }

Usage Example

		public void ReadOnly ()
		{
			IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication ();
			try {
				using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream ("read-only", FileMode.Create, FileAccess.Write, isf)) {
					fs.WriteByte (0);
				}
				// now we open it read-only
				using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream ("read-only", FileMode.Open, FileAccess.Read, isf)) {
					Assert.Throws (delegate { fs.WriteByte (0); }, typeof (NotSupportedException), "WriteByte");
					Assert.Throws (delegate { fs.Write (new byte [0], 0, 0); }, typeof (NotSupportedException), "Write");
					Assert.Throws (delegate { fs.BeginWrite (new byte [0], 0, 0, null, null); }, typeof (NotSupportedException), "BeginWrite");
				}
			}
			finally {
				isf.DeleteFile ("read-only");
			}
		}
All Usage Examples Of System.IO.IsolatedStorage.IsolatedStorageFileStream::BeginWrite