¡@

Home 

c# Programming Glossary: io

What is the fastest way to create a checksum for large files in C#

http://stackoverflow.com/questions/1177607/what-is-the-fastest-way-to-create-a-checksum-for-large-files-in-c-sharp

My first attempt was something like this using System.IO using System.Security.Cryptography private static string GetChecksum.. from the filestream which is too small a buffer for disk IO. To speed things up 2 minutes for hashing 2 Gb file on my machine..

When to use thread pool in C#?

http://stackoverflow.com/questions/145304/when-to-use-thread-pool-in-c

parallel use the pool scheduler. If you need to make your IO related tasks concurrently such as downloading stuff from remote..

How can I upload a file and save it to a Stream for further preview using C#?

http://stackoverflow.com/questions/1653469/how-can-i-upload-a-file-and-save-it-to-a-stream-for-further-preview-using-c

end is reached. The data is returned as a byte array. An IOException is thrown if any of the underlying IO calls fail. summary.. array. An IOException is thrown if any of the underlying IO calls fail. summary param name stream The stream to read data.. buffer length param public static byte ReadFully System.IO.Stream stream long initialLength reset pointer just in case..

C# - System.Transactions.TransactionScope

http://stackoverflow.com/questions/2273419/c-sharp-system-transactions-transactionscope

It would seem crazy to me if it could make System.IO.File operations transactional. c# .net transactions transactionscope.. if there are components in .NET for transactional file IO but it is pretty easy to implement such component latest OS..

What's the fastest way to bulk insert a lot of data in SQL Server (C# client)

http://stackoverflow.com/questions/24200/whats-the-fastest-way-to-bulk-insert-a-lot-of-data-in-sql-server-c-client

spends a lot of time at 100 so it is clear that disk IO is the main issue but the speeds I'm getting are several orders..

File IO with Streams - Best Memory Buffer Size

http://stackoverflow.com/questions/3033771/file-io-with-streams-best-memory-buffer-size

IO with Streams Best Memory Buffer Size I am writing a small IO.. with Streams Best Memory Buffer Size I am writing a small IO library to assist with a larger hobby project. A part of this..

Use a .jar java library API in C#?

http://stackoverflow.com/questions/512124/use-a-jar-java-library-api-in-c

jar file then In C# use Process class for execute and map IO stream. I am semi familiar with the Process class in C# but..

Should i use ThreadPools or Task Parallel Library for IO-bound operations

http://stackoverflow.com/questions/5213695/should-i-use-threadpools-or-task-parallel-library-for-io-bound-operations

i use ThreadPools or Task Parallel Library for IO bound operations In one of my projects that's kinda an aggregator.. producing similar results to sequential approach for my IO bound case. So for IO bound operations in my case reading resources.. to sequential approach for my IO bound case. So for IO bound operations in my case reading resources from web is it..

C# Begin/EndReceive - how do I read large data?

http://stackoverflow.com/questions/582550/c-sharp-begin-endreceive-how-do-i-read-large-data

assuming you want the fullest benefit of asynchronous IO. If you look at the MSDN page for Socket.BeginReceive you'll..

Unblock File from within .net 4 c#

http://stackoverflow.com/questions/6374673/unblock-file-from-within-net-4-c-sharp

c theapp.exe Zone.Identifier you need to use the native IO routines to manipulate them here is a managed wrapper . share..

How to parse a text file in C# and be io bound?

http://stackoverflow.com/questions/7153315/how-to-parse-a-text-file-in-c-sharp-and-be-io-bound

bound It is known that if you read data from disc you are IO bound and you can process parse the read data much faster than.. System.Collections.Generic using System.Text using System.IO using System.Diagnostics using System.Runtime.InteropServices.. using System.ComponentModel namespace IOBound class Program static void Main string args string data..

How to “kill” background worker completely?

http://stackoverflow.com/questions/800767/how-to-kill-background-worker-completely

a windows application that runs a sequence of digital IO actions repeatedly. This sequence of actions starts when the..

File.Copy vs. Manual FileStream.Write For Copying File

http://stackoverflow.com/questions/1246899/file-copy-vs-manual-filestream-write-for-copying-file

moving files around on the file system to different locations including windows shares on the same network FTP sites AmazonS3.. get away with using System.IO.File.Copy source destination to copy a file. Since many times all we have is an input Stream.. like a MemoryStream we tried abstracting the Copy operation to take an input Stream and an output Stream but we are seeing..

How to check for file lock?

http://stackoverflow.com/questions/1304/how-to-check-for-file-lock

is to just open the file and catch any System.IO.IOException. c# .net io filelock share improve this question No unfortunately.. the file and catch any System.IO.IOException. c# .net io filelock share improve this question No unfortunately and.. c# .net io filelock share improve this question No unfortunately and if you think about it that information..

C#: Prepending to beginning of a file

http://stackoverflow.com/questions/1343044/c-prepending-to-beginning-of-a-file

across this problem and if so what did you do c# file io share improve this question Adding to the beginning of a.. so what did you do c# file io share improve this question Adding to the beginning of a file prepending as opposed to.. as opposed to appending is generally not a supported operation. Your #1 options is fine. If you can't write a temp file you..

Can I simply 'read' a file that is in use?

http://stackoverflow.com/questions/203837/can-i-simply-read-a-file-that-is-in-use

I can read this without copying it Or is that my only option c# file file io filesystems file permissions share improve.. without copying it Or is that my only option c# file file io filesystems file permissions share improve this question .. my only option c# file file io filesystems file permissions share improve this question You can read the file only..

Parsing CSV files in C#

http://stackoverflow.com/questions/2081418/parsing-csv-files-in-c-sharp

to basically deserialize the file into classes. c# csv io file handling share improve this question Let a library.. c# csv io file handling share improve this question Let a library handle all the nitty gritty details for you.. Repeat Yourself no need to re invent the wheel a gazillionth time.... You basically just need to define that shape of..

Validate image from file in C#

http://stackoverflow.com/questions/210650/validate-image-from-file-in-c-sharp

text file and rename it to image.jpg an OutOfMemory Exception will be thrown when image.jpg is loaded. I'm looking for a.. be thrown when image.jpg is loaded. I'm looking for a function that will validate an image given a stream or a file path of.. given a stream or a file path of the image. Example function prototype bool IsValidImage string fileName bool IsValidImage..

Creating application shortcut in a directory

http://stackoverflow.com/questions/234231/creating-application-shortcut-in-a-directory

application shortcut in a directory How do you create an application shortcut.. shortcut in a directory How do you create an application shortcut .lnk file in C# or using the .NET framework The result.. The result would be a .lnk file to the specified application or URL. c# .net file io shortcut share improve this question..

File being used by another process after using File.Create()

http://stackoverflow.com/questions/2781357/file-being-used-by-another-process-after-using-file-create

it. string filePath string.Format @ 0 M 1 .dat ConfigurationManager.AppSettings DirectoryPath costCentre if File.Exists.. write my text Any ideas how to fix it Thanks c# file io share improve this question The File.Create method creates.. how to fix it Thanks c# file io share improve this question The File.Create method creates the file and opens a FileStream..

Cannot delete directory with Directory.Delete(path, true)

http://stackoverflow.com/questions/329355/cannot-delete-directory-with-directory-deletepath-true

this should throw if files are in use or there is a permissions problem but otherwise it should delete the directory and all.. the directory and all of its contents. However I occasionally get this System.IO.IOException The directory is not empty... However I occasionally get this System.IO.IOException The directory is not empty. at System.IO.__Error.WinIOError..

How do you read a file which is in use?

http://stackoverflow.com/questions/3709104/how-do-you-read-a-file-which-is-in-use

text of the log file even if it is already in use c# file io share improve this question using FileStream stream File.Open.. it is already in use c# file io share improve this question using FileStream stream File.Open path to file FileMode.Open..

Can .NET load and parse a properties file equivalent to Java Properties class?

http://stackoverflow.com/questions/485659/can-net-load-and-parse-a-properties-file-equivalent-to-java-properties-class

out the key name and equals sign myself The C# information I have found seems to always favor XML but this is an existing.. it to XML than parsing the existing file. c# configuration file io load share improve this question No there is no.. XML than parsing the existing file. c# configuration file io load share improve this question No there is no built in..

Download/Stream file from URL - asp.net

http://stackoverflow.com/questions/5596747/download-stream-file-from-url-asp-net

unable to use Server.MapPath to determine it's actual location. The directory is not in the same location or even phyical.. actual location. The directory is not in the same location or even phyical server on the live boxes as the website. I'd.. System.IO.FileInfo filePath Response.ContentType application octet stream Response.AddHeader Content Disposition String.Format..

How to add a Timeout to Console.ReadLine()?

http://stackoverflow.com/questions/57615/how-to-add-a-timeout-to-console-readline

to the prompt. If no input is made after a certain period of time program logic should continue. We assume a timeout.. way of approaching this c# .net console timeout io share improve this question I'm surprised to learn that after.. this c# .net console timeout io share improve this question I'm surprised to learn that after 5 years all of the answers..

How to both Read/Write File in C#

http://stackoverflow.com/questions/605685/how-to-both-read-write-file-in-c-sharp

can I both read from and write to a file in C# c# file io filestream share improve this question Don't forget the.. in C# c# file io filestream share improve this question Don't forget the easy route static void Main string args..

open file in exclusive mode in C#

http://stackoverflow.com/questions/685135/open-file-in-exclusive-mode-in-c-sharp

by some process thread else I want to receive an exception. I tried the following code but not working even if I opened.. Console.WriteLine I am here return c# file io exclusive share improve this question What you are doing.. return c# file io exclusive share improve this question What you are doing is the right thing. Probably you are just..

Getting path relative to the current working directory?

http://stackoverflow.com/questions/703281/getting-path-relative-to-the-current-working-directory

similar to the VirtualPathUtility.MakeRelative function but if there is it eludes me. c# file io share improve this.. function but if there is it eludes me. c# file io share improve this question If you don't mind the slashes.. is it eludes me. c# file io share improve this question If you don't mind the slashes being switched you could ab..

Is there a way to check if a file is in use?

http://stackoverflow.com/questions/876473/is-there-a-way-to-check-if-a-file-is-in-use

Googling has only yielded creating checks by using exception handling. This is against my religion so I was wondering if.. by using exception handling. This is against my religion so I was wondering if anyone has a better way of doing it .. wondering if anyone has a better way of doing it c# file io file locking share improve this question I've used this code..

System.UnauthorizedAccessException: Access to the path denied

http://stackoverflow.com/questions/8821410/system-unauthorizedaccessexception-access-to-the-path-denied

Access to the path denied I am having a problem where I am.. where I am trying to delete my file but I get an exception. if result Success if FileUpload.HasFile try File.Delete.. try File.Delete Request.PhysicalApplicationPath app_settings.login_images txtUploadStatus.Text string..

How can I determine if a file is binary or text in c#?

http://stackoverflow.com/questions/910873/how-can-i-determine-if-a-file-is-binary-or-text-in-c

way to do it even quick and dirty ugly in c# c# text file io binary share improve this question I would probably look.. in c# c# text file io binary share improve this question I would probably look for an abundance of control characters.. sufficient to catch most files. If you care about localization you'd need to test multi byte patterns as well. As stated though..

How do I restore a file from the recycle bin using C#?

http://stackoverflow.com/questions/911391/how-do-i-restore-a-file-from-the-recycle-bin-using-c

restored from the recycle bin c# .net file io recycle bin share improve this question There seems not.. bin c# .net file io recycle bin share improve this question There seems not to be a solution in pure C#. You most likely.. share improve this question There seems not to be a solution in pure C#. You most likely have to resort to P Invoke. This..