![]() |
|
[C#] Split file - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] Split file (/showthread.php?tid=5572317) |
Split file - Raymond - Mar 11, 2017 Hello. Tell me how you can divide the file into parts. I think that you need to read all the bytes, divide them into parts and encrypt each part. Tell me how it can be done. If there is an example, I will be grateful. Thank you for the help. * - severos - Mar 11, 2017 1-open input file 2-read part 3-write to output file 4-if input file not done: goto 2 * - ShadowCloudGH - Mar 11, 2017 You are essentially going to want to do something like this (from http://caioproiete.net/en/split-text-file-into-several-files-using-csharp/) Code using (var sourceFile = new StreamReader(sourceFileName))You can either do it as per max lines like above or tweak this so it does equal parts, kind of like most decent compression utilities do it. * - Raymond - Mar 11, 2017 (Mar 11, 2017 08:04 AM)Piramyd Wrote: I can already tell that you're trying to make a crypter just from reading your post. Anyways, I have my own crypter and I wrote code to do this. Essentially what you're going to want to do is: Could you share an example? I have a problem with division into parts ( * - Zilog80 - Mar 11, 2017 Step #1: https://www.nuget.org/packages/DotNetZip/ Step #2: PHP Code Result: test.zip test.z01 test.z02 test.z03 ... Profit * - Raymond - Mar 11, 2017 (Mar 11, 2017 12:03 PM)Zilog80 Wrote: Step #1: I need to get byte for further encryption. * - Zilog80 - Mar 11, 2017 (Mar 11, 2017 12:18 PM)jepko Wrote: I need to get byte for further encryption. Post title: Split file. 1st sentence: Hello. Tell me how you can divide the file into parts. The junk snippet I provided you on above reply is what post title said and what 1st sentence said. Now, you are changing the premisses. Be more clear, my friend. * - severos - Mar 11, 2017 (Mar 11, 2017 12:18 PM)jepko Wrote: I need to get byte for further encryption. read the files again and encrypt them? or you can use a zip stream (single stream) but you'll have to manually split the encrypted stream. * - Raymond - Mar 11, 2017 (Mar 11, 2017 12:31 PM)severos Wrote: read the files again and encrypt them? or you can use a zip stream (single stream) but you'll have to manually split the encrypted stream. I think first of all to separate bute and then to encrypt them * - Raymond - Mar 12, 2017 (Mar 11, 2017 04:24 PM)Piramyd Wrote: Show me what you've written so far.But for some reason when I collect a file it turns out smaller. PHP Code It turns out the code works. The problem is that when I collect back, the size is less and the file does not work. * - Raymond - Mar 12, 2017 The problem was that not all bytes were written down.) I understood. Thanks to all. |