|
Dieser Artikel wurde maschinell übersetzt. Bewegen Sie den Mauszeiger über die Sätze im Artikel, um den Originaltext anzuzeigen. Weitere Informationen
|
Übersetzung
Original
|
FileStream-Klasse
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Der FileStream-Typ macht die folgenden Member verfügbar.
| Name | Beschreibung | |
|---|---|---|
![]() | FileStream(IntPtr, FileAccess) | Veraltet. |
![]() | FileStream(SafeFileHandle, FileAccess) | |
![]() ![]() | FileStream(String, FileMode) | |
![]() | FileStream(IntPtr, FileAccess, Boolean) | Veraltet. |
![]() | FileStream(SafeFileHandle, FileAccess, Int32) | |
![]() ![]() | FileStream(String, FileMode, FileAccess) | |
![]() | FileStream(IntPtr, FileAccess, Boolean, Int32) | Veraltet. |
![]() | FileStream(SafeFileHandle, FileAccess, Int32, Boolean) | |
![]() ![]() | FileStream(String, FileMode, FileAccess, FileShare) | |
![]() | FileStream(IntPtr, FileAccess, Boolean, Int32, Boolean) | Veraltet. |
![]() ![]() | FileStream(String, FileMode, FileAccess, FileShare, Int32) | |
![]() ![]() | FileStream(String, FileMode, FileAccess, FileShare, Int32, Boolean) | |
![]() | FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions) | |
![]() | FileStream(String, FileMode, FileSystemRights, FileShare, Int32, FileOptions) | |
![]() | FileStream(String, FileMode, FileSystemRights, FileShare, Int32, FileOptions, FileSecurity) |
| Name | Beschreibung | |
|---|---|---|
![]() ![]() | CanRead | |
![]() ![]() | CanSeek | |
![]() ![]() | CanTimeout | |
![]() ![]() | CanWrite | |
![]() | Handle | Veraltet. |
![]() ![]() | IsAsync | |
![]() ![]() | Length | |
![]() ![]() | Name | |
![]() ![]() | Position | |
![]() ![]() | ReadTimeout | |
![]() | SafeFileHandle | |
![]() ![]() | WriteTimeout |
| Name | Beschreibung | |
|---|---|---|
![]() ![]() | BeginRead | In XNA Framework 3.0 wird dieser Member von Stream geerbt..BeginRead(Byte[], Int32, Int32, AsyncCallback, Object). |
![]() ![]() | BeginWrite | In XNA Framework 3.0 wird dieser Member von Stream geerbt..BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object). |
![]() ![]() | Close | |
![]() | CopyTo(Stream) | |
![]() | CopyTo(Stream, Int32) | |
![]() | CopyToAsync(Stream) | |
![]() | CopyToAsync(Stream, Int32) | |
![]() | CopyToAsync(Stream, Int32, CancellationToken) | |
![]() | CreateObjRef | |
![]() ![]() | CreateWaitHandle | Veraltet. |
![]() ![]() | Dispose() | |
![]() ![]() | Dispose(Boolean) | |
![]() ![]() | EndRead | In XNA Framework 3.0 wird dieser Member von Stream geerbt..EndRead(IAsyncResult). |
![]() ![]() | EndWrite | In XNA Framework 3.0 wird dieser Member von Stream geerbt..EndWrite(IAsyncResult). |
![]() ![]() | Equals(Object) | |
![]() ![]() | Finalize | |
![]() ![]() | Flush() | |
![]() | Flush(Boolean) | |
![]() | FlushAsync() | |
![]() | FlushAsync(CancellationToken) | |
![]() | GetAccessControl | |
![]() ![]() | GetHashCode | |
![]() | GetLifetimeService | |
![]() ![]() | GetType | |
![]() | InitializeLifetimeService | |
![]() | Lock | |
![]() ![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | |
![]() | ObjectInvariant | Infrastruktur. Veraltet. |
![]() ![]() | Read | |
![]() | ReadAsync(Byte[], Int32, Int32) | |
![]() | ReadAsync(Byte[], Int32, Int32, CancellationToken) | |
![]() ![]() | ReadByte | |
![]() ![]() | Seek | |
![]() | SetAccessControl | |
![]() ![]() | SetLength | |
![]() ![]() | ToString | |
![]() | Unlock | |
![]() ![]() | Write | |
![]() | WriteAsync(Byte[], Int32, Int32) | |
![]() | WriteAsync(Byte[], Int32, Int32, CancellationToken) | |
![]() ![]() | WriteByte |
| Name | Beschreibung | |
|---|---|---|
![]() | AsInputStream | |
![]() | AsOutputStream |
Hinweis |
|---|
Erkennung von Streampositions-Änderungen
using System; using System.IO; using System.Text; class Test { public static void Main() { string path = @"c:\temp\MyTest.txt"; // Delete the file if it exists. if (File.Exists(path)) { File.Delete(path); } //Create the file. using (FileStream fs = File.Create(path)) { AddText(fs, "This is some text"); AddText(fs, "This is some more text,"); AddText(fs, "\r\nand this is on a new line"); AddText(fs, "\r\n\r\nThe following is a subset of characters:\r\n"); for (int i=1;i < 120;i++) { AddText(fs, Convert.ToChar(i).ToString()); } } //Open the stream and read it back. using (FileStream fs = File.OpenRead(path)) { byte[] b = new byte[1024]; UTF8Encoding temp = new UTF8Encoding(true); while (fs.Read(b,0,b.Length) > 0) { Console.WriteLine(temp.GetString(b)); } } } private static void AddText(FileStream fs, string value) { byte[] info = new UTF8Encoding(true).GetBytes(value); fs.Write(info, 0, info.Length); } }
using System; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.IO; namespace WpfApplication1 { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private async void Button_Click(object sender, RoutedEventArgs e) { UnicodeEncoding uniencoding = new UnicodeEncoding(); string filename = @"c:\Users\exampleuser\Documents\userinputlog.txt"; byte[] result = uniencoding.GetBytes(UserInput.Text); using (FileStream SourceStream = File.Open(filename, FileMode.OpenOrCreate)) { SourceStream.Seek(0, SeekOrigin.End); await SourceStream.WriteAsync(result, 0, result.Length); } } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.
