445 references to FileMode
Microsoft.Activities.Build (2)
Microsoft\Activities\Build\Validation\ReportDeferredValidationErrorsTask.cs (1)
55using (FileStream stream = new FileStream(filePath, FileMode.Open))
Microsoft\Activities\Build\Validation\ValidationBuildExtension.cs (1)
66using (FileStream stream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
mscorlib (95)
microsoft\win32\win32native.cs (3)
971SECURITY_ATTRIBUTES securityAttrs, System.IO.FileMode dwCreationDisposition, 995SECURITY_ATTRIBUTES securityAttrs, System.IO.FileMode dwCreationDisposition, 1013SECURITY_ATTRIBUTES securityAttrs, System.IO.FileMode dwCreationDisposition,
system\activationcontext.cs (1)
445using (FileStream fs = new FileStream(manifestPath, FileMode.Open, FileAccess.Read))
system\io\directory.cs (1)
1513FileMode.Open,
system\io\file.cs (13)
178using(SafeFileHandle handle = Win32Native.UnsafeCreateFile(fullSourceFileName, FileStream.GENERIC_READ, FileShare.Read, null, FileMode.Open, 0, IntPtr.Zero)) { 221return new FileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None, bufferSize); 227return new FileStream(path, FileMode.Create, FileAccess.ReadWrite, 233return new FileStream(path, FileMode.Create, FileSystemRights.Read | FileSystemRights.Write, 467public static FileStream Open(String path, FileMode mode) { 468return Open(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.None); 473public static FileStream Open(String path, FileMode mode, FileAccess access) { 479public static FileStream Open(String path, FileMode mode, FileAccess access, FileShare share) { 769return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); 776return new FileStream(path, FileMode.OpenOrCreate, 917using(FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 978using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, 1457FileStream fs = new FileStream(path, FileMode.Open, access, FileShare.ReadWrite, 1);
system\io\fileinfo.cs (5)
405public FileStream Open(FileMode mode) { 411public FileStream Open(FileMode mode, FileAccess access) { 417public FileStream Open(FileMode mode, FileAccess access, FileShare share) { 429return new FileStream(FullPath, FileMode.Open, FileAccess.Read, 437return new FileStream(FullPath, FileMode.OpenOrCreate,
system\io\filestream.cs (27)
511public FileStream(String path, FileMode mode) 512: this(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.Read, DefaultBufferSize, FileOptions.None, Path.GetFileName(path), false) { 518public FileStream(String path, FileMode mode, FileAccess access) 525public FileStream(String path, FileMode mode, FileAccess access, FileShare share) 532public FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize) 541public FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options) 553public FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool useAsync) 564public FileStream(String path, FileMode mode, FileSystemRights rights, FileShare share, int bufferSize, FileOptions options, FileSecurity fileSecurity) 582public FileStream(String path, FileMode mode, FileSystemRights rights, FileShare share, int bufferSize, FileOptions options) 592internal FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, String msgPath, bool bFromProxy) 601internal FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, String msgPath, bool bFromProxy, bool useLongPath) 610internal FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, String msgPath, bool bFromProxy, bool useLongPath, bool checkHost) 620private void Init(String path, FileMode mode, FileAccess access, int rights, bool useRights, FileShare share, int bufferSize, FileOptions options, Win32Native.SECURITY_ATTRIBUTES secAttrs, String msgPath, bool bFromProxy, bool useLongPath, bool checkHost) 644if (mode < FileMode.CreateNew || mode > FileMode.Append) 673if (mode==FileMode.Truncate || mode==FileMode.CreateNew || mode==FileMode.Create || mode==FileMode.Append) { 687if (useRights && (mode == FileMode.Truncate)) { 739if (mode == FileMode.Append) 762Contract.Assert(mode != FileMode.Append); 782&& mode==FileMode.OpenOrCreate) 788if (mode==FileMode.Append) 818bool seekToEnd = (mode==FileMode.Append); 820if (mode == FileMode.Append) 821mode = FileMode.OpenOrCreate;
system\io\isolatedstorage\isolatedstoragefile.cs (6)
1259public IsolatedStorageFileStream OpenFile(string path, FileMode mode) { 1265public IsolatedStorageFileStream OpenFile(string path, FileMode mode, FileAccess access) { 1270public IsolatedStorageFileStream OpenFile(string path, FileMode mode, FileAccess access, FileShare share) { 1276return new IsolatedStorageFileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None, this); 2385using(FileStream fs = new FileStream(path + s_IDFile, FileMode.OpenOrCreate)) { 2763using(FileStream fs = new FileStream(sb.ToString(), FileMode.Open)) {
system\io\isolatedstorage\isolatedstoragefilestream.cs (24)
55public IsolatedStorageFileStream(String path, FileMode mode) 56: this(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.None, null) { 61public IsolatedStorageFileStream(String path, FileMode mode, 63: this(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.None, isf) 70public IsolatedStorageFileStream(String path, FileMode mode, 79public IsolatedStorageFileStream(String path, FileMode mode, 88public IsolatedStorageFileStream(String path, FileMode mode, 96public IsolatedStorageFileStream(String path, FileMode mode, 104public IsolatedStorageFileStream(String path, FileMode mode, 115public IsolatedStorageFileStream(String path, FileMode mode, 148case FileMode.CreateNew: // Assume new file 149case FileMode.Create: // Check for New file & Unreserve 150case FileMode.OpenOrCreate: // Check for new file 151case FileMode.Truncate: // Unreserve old file size 152case FileMode.Append: // Check for new file 153case FileMode.Open: // Open existing, else exception 185case FileMode.CreateNew: // Assume new file 193case FileMode.Create: // Check for New file & Unreserve 194case FileMode.OpenOrCreate: // Check for new file 195case FileMode.Truncate: // Unreserve old file size 196case FileMode.Append: // Check for new file 215case FileMode.Open: // Open existing, else exception 271((mode == FileMode.Truncate) || (mode == FileMode.Create)))
system\io\longpath.cs (1)
226using(SafeFileHandle handle = Win32Native.UnsafeCreateFile(fullSourceFileName, FileStream.GENERIC_READ, FileShare.Read, null, FileMode.Open, 0, IntPtr.Zero)) {
system\io\streamreader.cs (1)
240Stream stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, DefaultFileStreamBufferSize, FileOptions.SequentialScan, Path.GetFileName(path), false, false, checkHost);
system\io\streamwriter.cs (3)
225FileMode mode = append? FileMode.Append: FileMode.Create;
system\reflection\assembly.cs (2)
2267FileMode.Open, 2286FileMode.Open,
system\resources\resourcereader.cs (1)
167_store = new BinaryReader(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read, DefaultFileStreamBufferSize, FileOptions.RandomAccess, Path.GetFileName(fileName), false), Encoding.UTF8);
system\resources\resourcewriter.cs (2)
109_output = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); 363dataSection = new FileStream(tempFile, FileMode.Open, FileAccess.ReadWrite, FileShare.Read,
system\resources\runtimeresourceset.cs (1)
196Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
system\security\permissions\permissionattributes.cs (1)
1198return BruteForceParseStream( new FileStream( m_file, FileMode.Open, FileAccess.Read) );
system\security\policy\applicationsecuritymanager.cs (1)
129using (FileStream contents = new FileStream(s_machineConfigFile, FileMode.Open, FileAccess.Read))
system\security\policy\policylevel.cs (1)
808using (FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read)) {
system\security\securitymanager.cs (1)
187using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read)) {
PresentationBuildTasks (6)
BuildTasks\Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
69new FileStream(absoluteFilePath, FileMode.Create),
BuildTasks\Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (1)
64_sourceStream = new FileStream(_sourcePath, FileMode.Open, FileAccess.Read, FileShare.Read);
BuildTasks\Microsoft\Build\Tasks\Windows\UidManager.cs (2)
261using (Stream uidStream = new FileStream(tempFile, FileMode.Create)) 315using (Stream uidStream = new FileStream(tempFile, FileMode.Create))
BuildTasks\Ms\Internal\MarkupCompiler\MarkupCompiler.cs (1)
1301using (FileStream bamlFileStream = new FileStream(filepath, FileMode.Create, FileAccess.Write))
Shared\System\Windows\Markup\ReflectionHelper.cs (1)
650using (FileStream fileStream = File.Open(filepath, FileMode.Open, FileAccess.Read, FileShare.Read))
PresentationCore (8)
Core\CSharp\MS\Internal\AppModel\SiteOfOriginPart.cs (1)
57protected override Stream GetStreamCore(FileMode mode, FileAccess access)
Core\CSharp\MS\Internal\IO\Packaging\ByteRangeDownloader.cs (1)
80_tempFileStream = File.Open(tempFileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
Core\CSharp\System\IO\Packaging\PackWebResponse.cs (2)
278Stream s = p.GetStream(FileMode.Open, FileAccess.Read); 684Stream s = p.GetStream(FileMode.Open, FileAccess.Read);
Core\CSharp\System\Windows\Input\Cursor.cs (1)
269using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Write, FileShare.None))
Core\CSharp\System\Windows\Media\Imaging\BitmapDecoder.cs (3)
1208bitmapStream = new System.IO.FileStream(uri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read); 1239bitmapStream = new System.IO.FileStream(uri.OriginalString, FileMode.Open, FileAccess.Read, FileShare.Read); 1472bitmapStream = new System.IO.FileStream(uri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read);
PresentationFramework (17)
src\Framework\Microsoft\Win32\OpenFileDialog.cs (2)
114fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); 171fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
src\Framework\Microsoft\Win32\SaveFileDialog.cs (1)
110return new FileStream(filename, FileMode.Create, FileAccess.ReadWrite);
src\Framework\MS\Internal\AppModel\ContentFilePart.cs (2)
75protected override Stream GetStreamCore(FileMode mode, FileAccess access) 171s = System.IO.File.Open(filename, FileMode.Open, FileAccess.Read, ResourceContainer.FileShare);
src\Framework\MS\Internal\AppModel\ResourcePart.cs (1)
87protected override Stream GetStreamCore(FileMode mode, FileAccess access)
src\Framework\MS\Internal\IO\Packaging\XpsFilter.cs (3)
369FileMode fileMode; 386fileMode = FileMode.Open; 664FileMode fileMode,
src\Framework\System\Windows\Controls\VirtualizingStackPanel.cs (1)
12451_writer = new BinaryWriter(File.Open(filename, FileMode.Create));
src\Framework\System\Windows\Documents\WinRTSpellerInterop.cs (2)
520using (FileStream stream = new FileStream(lexiconFilePath, FileMode.Open, FileAccess.Read)) 705using (FileStream sourceStream = new FileStream(sourcePath, FileMode.Open, FileAccess.Read))
src\Framework\System\Windows\Documents\WpfPayload.cs (3)
758_package = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite); 780Package package = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite); 801Package package = Package.Open(stream, FileMode.Open, FileAccess.Read);
src\Framework\System\Windows\Interop\DocobjHost.cs (1)
1403FileStream fileStream = new FileStream(manifestName, FileMode.Open, FileAccess.Read);
src\Framework\System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
53var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
System (35)
compmod\microsoft\csharp\csharpcodeprovider.cs (6)
674Stream temp = new FileStream(responseFileName, FileMode.Create, FileAccess.Write, FileShare.Read); 3399new FileStream(options.OutputAssembly, FileMode.Create, FileAccess.ReadWrite).Close(); 3464using (FileStream fs = new FileStream(options.OutputAssembly, FileMode.Open, FileAccess.Read, FileShare.Read)) 3511using(FileStream stream = File.Open(file, FileMode.Open, FileAccess.Read, share)) 3737Stream temp = new FileStream(filenames[i], FileMode.Create, FileAccess.Write, FileShare.Read); 3811FileStream fileStream = new FileStream(name, FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
compmod\microsoft\visualbasic\VBCodeProvider.cs (3)
2832new FileStream(options.OutputAssembly, FileMode.Create, FileAccess.ReadWrite).Close(); 2909FileStream fs = new FileStream(outputAssemblyFile, FileMode.Open, FileAccess.Read, FileShare.Read); 2947using(FileStream stream = File.Open(file, FileMode.Open, FileAccess.Read, share))
compmod\system\codedom\compiler\CodeCompiler.cs (6)
265Stream temp = new FileStream(filenames[i], FileMode.Create, FileAccess.Write, FileShare.Read); 348new FileStream(options.OutputAssembly, FileMode.Create, FileAccess.ReadWrite).Close(); 375FileStream outputStream = new FileStream(outputFile, FileMode.Open, 402FileStream fs = new FileStream(options.OutputAssembly, FileMode.Open, FileAccess.Read, FileShare.Read); 458Stream temp = new FileStream(responseFileName, FileMode.Create, FileAccess.Write, FileShare.Read); 503FileStream fileStream = new FileStream(name, FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
compmod\system\codedom\compiler\Executor.cs (1)
57return new FileStream(file, FileMode.CreateNew, FileAccess.Write, FileShare.Read | FileShare.Inheritable);
compmod\system\codedom\compiler\TempFiles.cs (1)
221using (tempFileStream = new FileStream(tempFileName, FileMode.CreateNew, FileAccess.Write)) { }
compmod\system\componentmodel\LicFileLicenseProvider.cs (1)
82Stream licStream = new FileStream(licenseFile, FileMode.Open, FileAccess.Read, FileShare.Read);
compmod\system\diagnostics\DefaultTraceListener.cs (1)
134using (Stream stream = file.Open(FileMode.OpenOrCreate)) {
net\System\Net\Cache\IERequestCache.cs (2)
628: base(entry.Filename, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete, 4096, async) 815base(entry.Filename, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 4096, async) {
net\System\Net\Configuration\UriSectionReader.cs (1)
65using (FileStream configFile = new FileStream(configFilePath, FileMode.Open, FileAccess.Read))
net\System\Net\filewebrequest.cs (3)
434request.m_stream = new FileWebStream(request, request.m_uri.LocalPath, FileMode.Create, FileAccess.Write, FileShare.Read); 566public FileWebStream(FileWebRequest request, string path, FileMode mode, FileAccess access, FileShare sharing) 576public FileWebStream(FileWebRequest request, string path, FileMode mode, FileAccess access, FileShare sharing, int length, bool async)
net\System\Net\filewebresponse.cs (1)
49FileMode.Open,
net\System\Net\mail\Attachment.cs (2)
89Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); 106Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
net\System\Net\mail\SmtpClient.cs (1)
407FileStream fileStream = new FileStream(pathAndFilename, FileMode.CreateNew);
net\System\Net\Sockets\Socket.cs (3)
1437fileStream = new FileStream(fileName,FileMode.Open,FileAccess.Read,FileShare.Read); 3617fileStream = new FileStream(fileName,FileMode.Open,FileAccess.Read,FileShare.Read); 9306new FileStream(spe.m_FilePath,FileMode.Open,FileAccess.Read,FileShare.Read);
net\System\Net\webclient.cs (3)
395fs = new FileStream(fileName, FileMode.Create, FileAccess.Write); 615fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); 2100fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
System.Activities (1)
System\Activities\Debugger\SourceLocationProvider.cs (1)
147using (FileStream fs = new FileStream(sourcePath, FileMode.Open, FileAccess.Read))
System.Activities.Presentation (3)
System.Activities.Presentation\System\Activities\Presentation\View\DesignerView.xaml.cs (3)
1100using (FileStream fs = new FileStream(fileName, FileMode.Create)) 1102Package package = Package.Open(fs, FileMode.Create); 1136using (FileStream fs = new FileStream(fileName, FileMode.Create))
System.AddIn (1)
System\Addin\MiniReflection\MetadataReader\PEFileReader.cs (1)
62FileStream TheFile = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.RandomAccess);
System.Configuration (5)
System\Configuration\AppSettingsSection.cs (1)
127using (Stream sourceFileStream = new FileStream(sourceFileFullPath, FileMode.Open, FileAccess.Read, FileShare.Read)) {
System\Configuration\Internal\InternalConfigHost.cs (2)
144return new FileStream(streamName, FileMode.Open, FileAccess.Read, FileShare.Read); 247stream = new FileStream(writeFileContext.TempNewFilename, FileMode.Create, FileAccess.Write, FileShare.Read);
System\Configuration\Internal\WriteFileContext.cs (2)
168FileMode.Open, 286FileMode.Open,
System.Core (15)
Microsoft\Win32\UnsafeNativeMethods.cs (3)
181SECURITY_ATTRIBUTES securityAttrs, System.IO.FileMode dwCreationDisposition, 189SECURITY_ATTRIBUTES securityAttrs, System.IO.FileMode dwCreationDisposition, 327UnsafeNativeMethods.SECURITY_ATTRIBUTES securityAttrs, System.IO.FileMode dwCreationDisposition,
System\IO\LogStream.cs (4)
61FileMode _modeSav; 104_modeSav = (retention != LogRetentionOption.SingleFileUnboundedSize)? FileMode.Create : FileMode.OpenOrCreate; 118FileMode mode, int flagsAndAttributes, bool seekToEnd)
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (6)
105return CreateFromFile(path, FileMode.Open, null, DefaultSize, MemoryMappedFileAccess.ReadWrite); 107public static MemoryMappedFile CreateFromFile(String path, FileMode mode) { 111public static MemoryMappedFile CreateFromFile(String path, FileMode mode, String mapName) { 115public static MemoryMappedFile CreateFromFile(String path, FileMode mode, String mapName, Int64 capacity) { 121public static MemoryMappedFile CreateFromFile(String path, FileMode mode, String mapName, Int64 capacity, 140if (mode == FileMode.Append) {
System\IO\Pipes\Pipe.cs (2)
1210FileMode.Open, // open existing 1335FileMode.Open, // open existing
System.Data (6)
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\DesignerView.xaml.cs (3)
1100using (FileStream fs = new FileStream(fileName, FileMode.Create)) 1102Package package = Package.Open(fs, FileMode.Create); 1136using (FileStream fs = new FileStream(fileName, FileMode.Create))
fx\src\data\System\Data\Common\AdapterUtil.cs (1)
2114return new FileStream(filename,FileMode.Open,FileAccess.Read,FileShare.Read);
fx\src\data\System\Data\DataSet.cs (1)
2562FileStream stream = new FileStream(fileName, FileMode.Open);
fx\src\data\System\Data\OleDb\oledbconnectionstring.cs (1)
288using(FileStream fstream = new FileStream(udlfilename, FileMode.Open, FileAccess.Read, FileShare.Read)) {
System.Data.Entity.Design (1)
System\Data\EntityModel\Emitters\ClientApiGenerator.cs (1)
120tempFileStream = new System.IO.FileStream(filename, System.IO.FileMode.CreateNew, System.IO.FileAccess.ReadWrite,
System.Data.Services.Design (1)
System\Data\EntityModel\Emitters\ClientApiGenerator.cs (1)
279tempFileStream = new System.IO.FileStream(filename, System.IO.FileMode.CreateNew, System.IO.FileAccess.ReadWrite,
System.Drawing (2)
commonui\System\Drawing\Icon.cs (1)
101using (FileStream f = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) {
commonui\System\Drawing\ToolboxBitmapAttribute.cs (1)
323FileStream reader = System.IO.File.Open(imageFile, FileMode.Open);
System.IO.Log (18)
System\IO\Log\FileRegion.cs (1)
78FileMode.Open,
System\IO\Log\LogRecordSequence.cs (5)
43FileMode mode) 55FileMode mode, 68FileMode mode, 82FileMode mode, 103FileMode mode,
System\IO\Log\LogStore.cs (10)
44FileMode mode) 51FileMode mode, 59FileMode mode, 72FileMode mode, 528FileMode mode, 535if (!((mode == FileMode.CreateNew) || 536(mode == FileMode.Open) || 537(mode == FileMode.OpenOrCreate))) 552if ((mode == FileMode.CreateNew) && ((access & FileAccess.Write) == 0)) 556if ((mode == FileMode.OpenOrCreate) && ((access & FileAccess.Write) == 0))
System\IO\Log\UnsafeNativeMethods.cs (2)
475System.IO.FileMode fCreateDisposition, 1868System.IO.FileMode fCreateDisposition,
System.Management (1)
WmiGenerator.cs (1)
215tw = new StreamWriter(new FileStream (filePath,FileMode.Create),System.Text.Encoding.UTF8);
System.Runtime.Remoting (1)
metadata\metadata.cs (1)
153FileStream fs = new FileStream(stfilename, FileMode.Create, FileAccess.ReadWrite);
System.Web (30)
Compilation\AssemblyBuilder.cs (3)
241Stream temp = new FileStream(generatedFilePath, FileMode.Create, FileAccess.Write, FileShare.Read); 667using (Stream stream = new FileStream(physicalPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { 1298Stream temp = new FileStream(generatedCodeFile, FileMode.Create, FileAccess.Write, FileShare.Read);
Compilation\BuildResult.cs (2)
1262using (FileStream stream = File.Open(_ccuPreservationFileName, FileMode.Open)) { 1283using (FileStream stream = File.Open(preservationFileName, FileMode.Create)) {
Configuration\BrowserCapabilitiesCodeGenerator.cs (3)
788TextWriter twriter = new StreamWriter(new FileStream(_browsersDirectory + "\\BrowserCapsFactory.cs", FileMode.Create)); 845using (FileStream pktStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) { 863using (FileStream pktStream = new FileStream(filename, FileMode.Open, FileAccess.Read)) {
Configuration\RemoteWebConfigurationHostServer.cs (1)
108tempFileStream = new FileStream(tempFile, FileMode.CreateNew, FileAccess.Write, FileShare.ReadWrite, data.Length, FileOptions.WriteThrough);
Configuration\StrongNameUtility.cs (1)
50using (FileStream snkStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) {
Hosting\ApplicationManager.cs (1)
1457FileStream file = new FileStream(configFile, FileMode.Open, FileAccess.Read);
Hosting\IIS7WorkerRequest.cs (1)
1047FileMode.Open,
Hosting\ISAPIWorkerRequest.cs (2)
1385f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); 1421f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
Hosting\MapPathBasedVirtualPathProvider.cs (1)
189return new FileStream(_physicalPath, FileMode.Open, FileAccess.Read, FileShare.Read);
HttpInputStream.cs (1)
236_filestream = new FileStream(_filename, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 4096, FileOptions.DeleteOnClose);
HttpPostedFile.cs (1)
111FileStream f = new FileStream(filename, FileMode.Create);
HttpRequest.cs (1)
2908FileStream f = new FileStream(filename, FileMode.Create);
HttpResponse.cs (4)
2769f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); 2816using (FileStream f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)) { 2847f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); 2895f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
HttpRuntime.cs (2)
1254using (FileStream fs = new FileStream(appOfflineFile, FileMode.Open, FileAccess.Read, FileShare.Read)) { 3243FileStream file = new FileStream(configFile, FileMode.Open, FileAccess.Read);
HttpWriter.cs (1)
470f = new FileStream(_filename, FileMode.Open, FileAccess.Read, FileShare.Read);
StringResourceManager.cs (1)
117using (Stream strm = new FileStream(resFileName, FileMode.Create)) {
UI\Control.cs (2)
2200return new FileStream(physicalPath, FileMode.Open, FileAccess.Read, FileShare.Read); 2225stream = new FileStream(physicalPath, FileMode.Open, FileAccess.Read, FileShare.Read);
UI\Util.cs (1)
306fs = new FileStream(dummyFile, FileMode.Create);
Util\SmtpMail.cs (1)
613File.Open(_filename, FileMode.Open, FileAccess.Read, FileShare.Read).Close();
System.Web.DataVisualization (7)
Common\General\Chart.cs (2)
3542FileMode.Open); 3630dataStream = new FileStream(url, FileMode.Open);
Common\Utilities\XmlSerializer.cs (2)
2264 FileStream stream = new FileStream(fileName, FileMode.Create); 2872 FileStream stream = new FileStream(fileName, FileMode.Open);
WebForm\ChartWebControl.cs (2)
1088 FileStream fileStream = new FileStream(imageFileName, FileMode.Create); 1264 FileStream fileStream = new FileStream(imageFileName, FileMode.Create);
WebForm\General\ChartHttpHandler.cs (1)
213_controllerFileStream = new System.IO.FileStream(controllerFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
System.Web.Extensions (3)
ClientServices\Providers\ClientData.cs (3)
172using(IsolatedStorageFileStream fs = new IsolatedStorageFileStream(FileName, FileMode.Create, f)) { 216using(IsolatedStorageFileStream fs = new IsolatedStorageFileStream(fileName, FileMode.Open, f)) { 228using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) {
System.Web.Services (1)
System\Web\Services\Discovery\DiscoveryRequestHandler.cs (1)
54stream = new FileStream(physicalPath, FileMode.Open, FileAccess.Read);
System.Windows.Forms (8)
winforms\Managed\System\Resources\ResXFileRef.cs (1)
307using (FileStream s = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) {
winforms\Managed\System\Resources\ResXResourceReader.cs (1)
286stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
winforms\Managed\System\WinForms\Cursor.cs (1)
123FileStream f = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
winforms\Managed\System\WinForms\OpenFileDialog.cs (1)
161s = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
winforms\Managed\System\WinForms\PropertyGrid.cs (2)
5333FileStream fs = new FileStream(fullFileName, FileMode.Create, FileAccess.Write); 5369FileStream fs = new FileStream(fullFileName, FileMode.Open, FileAccess.Read);
winforms\Managed\System\WinForms\RichTextBox.cs (1)
2417Stream file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
winforms\Managed\System\WinForms\SaveFileDialog.cs (1)
113s = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite);
System.Windows.Forms.DataVisualization (6)
Common\General\Chart.cs (2)
3542FileMode.Open); 3630dataStream = new FileStream(url, FileMode.Open);
Common\Utilities\XmlSerializer.cs (2)
2264 FileStream stream = new FileStream(fileName, FileMode.Create); 2872 FileStream stream = new FileStream(fileName, FileMode.Open);
WinForm\ChartWinControl.cs (2)
775 FileStream fileStream = new FileStream(imageFileName, FileMode.Create); 803 FileStream fileStream = new FileStream(imageFileName, FileMode.Create);
System.Workflow.ComponentModel (3)
AuthoringOM\Compiler\CompileXomlTask.cs (2)
630using (StreamWriter fileStream = new StreamWriter(new FileStream(tempFile, FileMode.Create, FileAccess.Write), Encoding.UTF8)) 1355FileStream fileStream = File.Open(tempFile, FileMode.Truncate);
AuthoringOM\Compiler\XomlCompilerHelpers.cs (1)
708Stream temp = new FileStream(filenames[i], FileMode.Create, FileAccess.Write, FileShare.Read);
System.WorkflowServices (2)
System\Workflow\Runtime\StreamedWorkflowDefinitionContext.cs (2)
58workflowDefStream = new FileStream(workflowDefinitionPath, FileMode.Open, FileAccess.Read); 62ruleDefStream = new FileStream(ruleDefinitionPath, FileMode.Open, FileAccess.Read);
System.Xml (5)
System\Xml\Core\XmlTextWriter.cs (1)
278: this(new FileStream(filename, FileMode.Create,
System\Xml\Core\XmlWriterSettings.cs (1)
454fs = new FileStream(outputFileName, FileMode.Create, FileAccess.Write, FileShare.Read, 0x1000, useAsync);
System\Xml\XmlDownloadManager.cs (1)
30return new FileStream( uri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1 );
System\Xml\XmlDownloadManagerAsync.cs (1)
23return Task.Run<Stream>(() => { return new FileStream(uri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1, true); });
System\Xml\Xslt\XslTransform.cs (1)
239fs = new FileStream(outputfile, FileMode.Create, FileAccess.ReadWrite);
WindowsBase (161)
Base\MS\Internal\IO\Packaging\Certificate.cs (1)
134using (Stream s = _part.GetStream(FileMode.Create, FileAccess.Write))
Base\MS\Internal\IO\Packaging\CompoundFile\RightsManagementEncryptionTransform.cs (2)
824using (Stream stream = si.GetStream(FileMode.Open, FileAccess.Read)) 877using (Stream stream = si.GetStream(FileMode.Open, FileAccess.Read))
Base\MS\Internal\IO\Packaging\CompoundFile\UserUseLicenseDictionaryLoader.cs (1)
132using (Stream stream = si.GetStream(FileMode.Open, FileAccess.Read))
Base\MS\Internal\IO\Packaging\InterleavedZipPartStream.cs (2)
59internal InterleavedZipPartStream(ZipPackagePart owningPart, FileMode mode, FileAccess access) 71FileMode mode, FileAccess access)
Base\MS\Internal\IO\Packaging\InternalRelationshipCollection.cs (2)
289using (Stream s = part.GetStream(FileMode.Open, FileAccess.Read)) 781FileMode.CreateNew, FileAccess.Write);
Base\MS\Internal\IO\Packaging\PartBasedPackageProperties.cs (3)
564Stream stream = part.GetStream(FileMode.Open, FileAccess.Read); 772writerStream = _propertyPart.GetStream(FileMode.Create, FileAccess.Write); 774writerStream = new IgnoreFlushAndCloseStream(_propertyPart.GetStream(FileMode.Create, FileAccess.Write));
Base\MS\Internal\IO\Packaging\PieceDirectory.cs (2)
163internal PieceDirectory(List<PieceInfo> sortedPieceInfoList, FileMode mode, FileAccess access) 536private FileMode _fileMode;
Base\MS\Internal\IO\Packaging\streamingZipPartStream.cs (5)
53FileMode mode, 57if (!( (mode == FileMode.Create || mode == FileMode.CreateNew) 323_pieceStream = zipFileInfo.GetStream(FileMode.Create, _access); 354private FileMode _mode;
Base\MS\Internal\IO\Packaging\XmlDigitalSignatureProcessor.cs (2)
189s = part.GetStream(FileMode.Open, FileAccess.Read); 999using (Stream s = SignaturePart.GetStream(FileMode.Create, FileAccess.Write))
Base\MS\Internal\IO\Packaging\XmlSignatureManifest.cs (1)
786using (Stream s = part.GetStream(FileMode.Open, FileAccess.Read))
Base\MS\Internal\IO\Zip\ZipArchive.cs (37)
71internal static ZipArchive OpenOnFile(string path, FileMode mode, FileAccess access, FileShare share, bool streaming) 73if (mode == FileMode.OpenOrCreate || mode == FileMode.Open) 126internal static ZipArchive OpenOnStream(Stream stream, FileMode mode, FileAccess access, bool streaming) 140case FileMode.Open: 148case FileMode.CreateNew: 154case FileMode.Create: 451private ZipArchive(Stream archiveStream, FileMode mode, FileAccess access, bool streaming, bool ownStream) 465if ((_openMode == FileMode.CreateNew) || 466(_openMode == FileMode.Create) || 467((_openMode == FileMode.OpenOrCreate) && archiveStream.Length == 0)) 524static private void ValidateModeAccessShareStreaming(Stream stream, FileMode mode, FileAccess access, FileShare share, bool streaming) 592static private void ValidateModeAccessShareSupportedEnums(FileMode mode, FileShare share) 598if (mode == FileMode.Append || mode == FileMode.Truncate) 609static private void ValidateModeAccessShareValidEnums(FileMode mode, FileAccess access, FileShare share) 614if ((mode != FileMode.Append) && (mode != FileMode.Create) && (mode != FileMode.CreateNew) && (mode != FileMode.Open) 615&& (mode != FileMode.OpenOrCreate) && (mode != FileMode.Truncate)) 674{(int)FileMode.Create, (int)FileAccess.Write, (int)FileShare.None, 1}, 675{(int)FileMode.Create, (int)FileAccess.Write, (int)FileShare.Read, 1}, 676{(int)FileMode.Create, (int)FileAccess.ReadWrite, (int)FileShare.None, 0}, 677{(int)FileMode.CreateNew, (int)FileAccess.Write, (int)FileShare.None, 1}, 678{(int)FileMode.CreateNew, (int)FileAccess.Write, (int)FileShare.Read, 1}, 679{(int)FileMode.CreateNew, (int)FileAccess.ReadWrite, (int)FileShare.None, 0}, 680{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.None, 1}, 681{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.None, 0}, 682{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.Read, 1}, 683{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.Read, 0}, 684{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.Write, 1}, 685{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.ReadWrite, 1}, 686{(int)FileMode.Open, (int)FileAccess.ReadWrite, (int)FileShare.None, 0}, 687{(int)FileMode.OpenOrCreate, (int)FileAccess.ReadWrite, (int)FileShare.None, 0} 692private FileMode _openMode;
Base\MS\Internal\IO\Zip\ZipFileInfo.cs (1)
53internal Stream GetStream(FileMode mode, FileAccess access)
Base\MS\Internal\IO\Zip\ZipIOLocalFileBlock.cs (7)
436internal Stream GetStream(FileMode mode, FileAccess access) 446case FileMode.Create: 458case FileMode.Open: 460case FileMode.OpenOrCreate: 462case FileMode.CreateNew: 466case FileMode.Append: 468case FileMode.Truncate:
Base\System\IO\Packaging\CompoundFile\DataSpaceManager.cs (5)
1058using(Stream dataSpaceMapStream = dataSpaceMapStreamInfo.GetStream(FileMode.Open)) 1143using(Stream dataSpaceMapStream = dataSpaceMapStreamInfo.GetStream(FileMode.Create)) 1212using(Stream definitionStream = definitionStreamInfo.GetStream(FileMode.Open)) 1335using(Stream transformDefinition = transformPrimary.GetStream(FileMode.Open)) 1617using (Stream versionStream = versionStreamInfo.GetStream(FileMode.Open))
Base\System\IO\Packaging\CompoundFile\StorageRoot.cs (21)
41const FileMode defaultFileMode = FileMode.OpenOrCreate; 117return CreateOnStream( baseStream, FileMode.Create ); 121return CreateOnStream( baseStream, FileMode.Open ); 131internal static StorageRoot CreateOnStream(Stream baseStream, FileMode mode) 150if( FileMode.Create == mode ) 161if( FileMode.Create == mode ) 168else if( FileMode.Open == mode ) 211FileMode mode ) 223FileMode mode, 237FileMode mode, 252FileMode mode, 272case FileMode.Append: 275case FileMode.Create: 278case FileMode.CreateNew: 287goto case FileMode.Create; 288case FileMode.Open: 290case FileMode.OpenOrCreate: 296goto case FileMode.Open; 301goto case FileMode.Create; 304case FileMode.Truncate:
Base\System\IO\Packaging\CompoundFile\StreamInfo.cs (21)
89const FileMode defaultFileOpenMode = FileMode.OpenOrCreate; 90const FileMode defaultFileCreateMode = FileMode.Create; 249public Stream GetStream( FileMode mode ) 260public Stream GetStream( FileMode mode, FileAccess access ) 290case FileMode.Append: 293case FileMode.Create: 318case FileMode.CreateNew: 321case FileMode.Open: 333case FileMode.OpenOrCreate: 387case FileMode.Truncate: 422private Stream Create( FileMode mode ) 443private Stream Create( FileMode mode, FileAccess access ) 455internal Stream Create( FileMode mode, FileAccess access, string dataSpace ) 502case FileMode.Create: 523case FileMode.CreateNew: 534case FileMode.Append: // None of these are valid in a Create 535case FileMode.Open: 536case FileMode.OpenOrCreate: 537case FileMode.Truncate:
Base\System\IO\Packaging\EncryptedPackage.cs (11)
515root = StorageRoot.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); 573root = StorageRoot.CreateOnStream(stream, FileMode.Open); 753FileMode.Open, 1004_packageStream = siPackage.GetStream(FileMode.Open, this.FileOpenAccess); 1152FileMode.Create, 1164_package = Package.Open(_packageStream, FileMode.Open, this.FileOpenAccess); 1171_package = Package.Open(_packageStream, FileMode.Create, FileAccess.ReadWrite); 1227private const FileMode _defaultFileModeForCreate = FileMode.Create; 1231private const FileMode _defaultFileModeForOpen = FileMode.Open;
Base\System\IO\Packaging\Package.cs (18)
161public static Package Open(string path, FileMode packageMode) 178public static Package Open(string path, FileMode packageMode, FileAccess packageAccess) 204public static Package Open(string path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare) 241public static Package Open(Stream stream, FileMode packageMode) 261public static Package Open(Stream stream, FileMode packageMode, FileAccess packageAccess) 933internal static void ThrowIfFileModeInvalid(FileMode mode) 936if (mode < FileMode.CreateNew || mode > FileMode.Append) 973FileMode packageMode, 1050internal static Package Open(Stream stream, FileMode packageMode, FileAccess packageAccess, bool streaming) 1200FileMode packageMode, 1207if (packageMode == FileMode.Create || packageMode == FileMode.CreateNew) 1225private static Stream ValidateModeAndAccess(Stream s, FileMode mode, FileAccess access) 1455private static readonly FileMode _defaultFileMode = FileMode.OpenOrCreate; 1459private static readonly FileMode _defaultStreamMode = FileMode.Open;
Base\System\IO\Packaging\PackagePart.cs (10)
310return GetStream(FileMode.OpenOrCreate, _container.FileOpenAccess); 329public Stream GetStream(FileMode mode) 353public Stream GetStream(FileMode mode, FileAccess access) 392protected abstract Stream GetStreamCore(FileMode mode, FileAccess access); 692GetStream(FileMode.CreateNew, _container.FileOpenAccess).Close(); 803private void ThrowIfOpenAccessModesAreIncompatible(FileMode mode, FileAccess access) 810(mode == FileMode.Create || mode == FileMode.CreateNew || mode == FileMode.Truncate || mode == FileMode.Append))
Base\System\IO\Packaging\ZipPackage.cs (6)
401internal ZipPackage(string path, FileMode mode, FileAccess access, FileShare share, bool streaming) 437internal ZipPackage(Stream s, FileMode mode, FileAccess access, bool streaming) 1044using (Stream s = _contentTypeFileInfo.GetStream(FileMode.Create, _zipArchive.OpenAccess)) 1303return _contentTypeFileInfo.GetStream(FileMode.Open, FileAccess.Read); 1315pieces, FileMode.Open, FileAccess.Read); 1497FileMode.Create, FileAccess.Write);
Base\System\IO\Packaging\ZipPackagePart.cs (1)
57protected override Stream GetStreamCore(FileMode mode, FileAccess access)
Shared\MS\Internal\IO\Packaging\PackagingUtilities.cs (2)
597string path, FileMode mode, FileAccess access, 739fileName, FileMode.Create, FileAccess.ReadWrite, FileShare.None,
XamlBuildTask (1)
Microsoft\Build\Tasks\Xaml\PartialClassGenerationTaskInternal.cs (1)
486using (XmlWriter xmlWriter = XmlWriter.Create(File.Open(markupFileName, FileMode.Create), xmlSettings))