|
Yes, that is what I'm hoping to achieve. The "older" way to write files.
But I need some example codes or a link perhaps.
Thank you.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
You can use BinaryReader.Read[^] in a loop, starting with offset 0 until the end of the file is reached, increasing the offset with the chunk size in every loop step.
If you wish I can post an example later (unless you won't find one on google or someone else answers in the meantime), I have to leave right now.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Please do so if you have time. Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Hello,
Perhaps you can use timer and keep an eye on disk space being consumed...
Like:
1. Have a timer
//do what you want..
2. Get free space in hard-disk you are playing with big files
3. Play with files
in timer tick check free space again, you do know the size of the file right? use these two and check approximately how much work has been done.
HTH!
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Hi,
That approach won't work, unfortunately. I already tried a similar approach using FileSystemWatcher. The problem is that File.WriteAllBytes() will initially write the full file size. I do not know why.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Why not try out with System.IO.DriveInfo?
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Alright, I'll try it and report back.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Adeel Chaudhry wrote: Why not try out with System.IO.DriveInfo?
Hi, I've tried it and the outcome is also the same as using the FileSystemWatcher.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Take a look at the FileStream class. That's the basis of reading and writing files, that's what WriteAllBytes, ReadAllBytes and all the different reader and writer classes use to access files.
MSDN Library: FileStream class[^]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Guffa,
My problem is that I don't know how to write a bytearray chunk by chunks.
Say I already have byte[] Data, and I want to write it 1024 bytes at a time.
Regards
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Use a loop.
Example:
int pos = 0;
int left = data.Length;
while (left > 0) {
int len = Math.Min(left, 1024);
stream.Write(data, pos, len);
pos += len;
left -= len;
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Exactly what I needed! Thank you!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Hi Guys
I am trying to write GoalSeek method of excel in c#, can anyone help me to get the algorithm behind Goal Seek, do not give me the VB examples, need something more generic.
Thanks in advance.
happy coding!
|
|
|
|
|
Have you Googled for [^]?
(At first sight, your task appears a bit complex )
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi,
Hope this is the right place to ask, I have the following problem:
I have a .Net 2.0 Forms/C# solution in visual studio 2005, running on windows Vista Ultimate (both fully up to date with patches).
When I open up VS2005 and select the project from the VS Start page, weird stuff starts to happen: While loading the project, VS decides to spontaneously start up the application (without me having touched any buttons).
I can't stop the program once it's running from the IDE: shift-F5 and the debug menu don't work. But as soon as I close my app manually, Visual Studio sometimes crashes immediately.
This happens about a third of the times I open my Visual Studio project. But if it doesn't, there's always a chance of it happening at some random time while I'm happily coding about: My project will just start to run spontaneously: No compiling or anything, just running the version I last compiled.
I've had this VS installation for over a year now, never had any problems with it. The problem only seems to occur with one specific solution: I don't have it with any other solutions I made.
Any advice?
Standards are great! Everybody should have one!
|
|
|
|
|
You have an exe maybe in your source control? I have never heard of this, so that is the best guess
|
|
|
|
|
Nope, no exe files in my solution. Haven't been able to even find someone with the same problem on the net and have been searching all day. This must be the weirdest problem I ever had.
Standards are great! Everybody should have one!
|
|
|
|
|
That is weird indeed. Maybe something stuck in the addin manager? Maybe a rogue plugin?
|
|
|
|
|
I need to display content printed from a third party control in another third party PrintPreview control (SpreadsheetGear and Infragistics controls, by the way). The c# Printdocument only allows you to "draw" what is to be printed manually, by means of the Graphics interface. For my data that is contained in a spreadsheet and can therefor be anything at all, that is not a valid solution at all. Is there any way at all to rather "intercept" a PrintDocument from a print job, and then bind that to a PrintPreview control?
Armand Smit
S-Tech Software Developers cc
|
|
|
|
|
I am working on a program to display pupil essay homework data.Making the program define class pupil and class homework. Program to display hardcoded data for homework such as 150words, word friend in text etc. User of program to be able to enter keywords to be checked for and be able to request to see such essay homework data for a pupil.
Any clues how to get on such a task ?
|
|
|
|
|
Learn a programming language, learn the associated libraries that go with the language and then create the application.
All of this should be relativly straight forward with books and online resources such as the MSDN, or you could even find someone to teach you.
|
|
|
|
|
As a beginner am confused on the whole thing
|
|
|
|
|
|
Really confused on how to connect objects of class student and objects of class homework.
|
|
|
|
|
Buy a book, take a class, or learn how to use Google. I know this is going to sound harsh, but we expect people here to at least have an understanding of the very basics of what they're trying to accomplish. We can't possibly be expected to teach you the basics.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|