Click here to Skip to main content
15,889,863 members
Everything / General Programming / File

File

file

Great Reads

by Tomaz Koritnik
TmStorage is a structureless virtual file system from which complex storages or databases can be built.
by Mark Pelf
Beginner’s tutorial on PE format, with illustrations
by Lodewijk Pool
A quick and easy way to direct Java System.out to File and to Console.
by Mikhail-T
How to convert string to text file and return it back to user as a result of a controller action

Latest Articles

by Mark Pelf
Beginner’s tutorial on PE format applied to .NET assemblies
by Mark Pelf
Beginner’s tutorial on PE format, with illustrations
by Michael Sydney Balloni
See how Rust stacks up against C-ish, C++, and C#
by Andreas "PAX" Lück
Investigation of PE file modifications performed by Microsoft Detours

All Articles

Sort by Title

File 

12 Jun 2012 by sigma_ivan
hi everyonei would like some help with the application that we developed.this is for our office use only, and what our app is doing is extracting the text from the pdf file using pdflibnet.dllbut we lately encountered a problem with a particular pdf file.the problem is when we try to...
6 Feb 2015 by User 11197367
HiI'd like to know how I can cut down a .avi file and make a .gif file out of it.I want to create a Proram you can use to ripoff episode-changing gags from the Intro. This is (more or less) useful for Series like The Simpsons or American DadThanks.Sincerely:Jonas
6 Feb 2015 by Zoltán Zörgő
Check these: A Simple C# Wrapper for the AviFile Library[^]NGif, Animated GIF Encoder for .NET[^]https://dotnetpuzzle.wordpress.com/2012/05/09/animated-gif-image-with-c/[^]You can find there much everything you need to make it working.
6 Feb 2015 by Gaurav_Chaudhary
Try FFMPEG binary executable to which you can feed in console commands and get the gif image from a video file and you have more advanced options like time interval of frame etc... ffmpeg -i video.avi -t 5 out.gif
25 May 2010 by Lokesh Lal
Hi, could some one point me where i can get the real media (.rm) and .mp3 file format details.I need a converter which can convert .rm files to .mp3 files using C#.Thanks.
25 May 2010 by Sandeep Mewara
You need to plug into an external library such as ffmpeg,DirectShowLib.Have a look at these articles:FFMPEG All in One Video & Audio Converter Interface[^]Media files conversion using C#[^]
21 Jun 2010 by nimi_2010
What softwares are recommended that are used to extract or view the .rul files??
21 Jun 2010 by Sandeep Mewara
RUL is a file extension associated with InstallShield Rules.Thus, open with InstallShield Professional.Look here:*.RUL extension[^]
20 Nov 2013 by Sergey Alexandrovich Kryukov
The question makes no sense at all. You are not even trying to clarify it in any reasonable way. It becomes pretty obvious that you don't understand your own questions and hardly can do the job you might mean to do.Please, next time make sure you understand what you are asking about. As I can...
24 Mar 2021 by wifinut
I'm trying to scan a text file for values that match some values that I obtain earlier. For clarity I'm statically assigning them here. The input file is a CSV but doesn't contain any commas. I'm open to using a plain text file if that helps. ...
24 Mar 2021 by k5054
Problem one seems to be a mix of UTF-8 and ASCII quotation marks (") in your code -- assuming you did a cut&paste from your source. Next, your logic is slightly off. You break the while loop and report no matches on the first non-match. One...
19 Dec 2010 by Ian Shlasko
Unless I'm misreading your code on CodePlex, it looks like your utility loads in the entire file every time it changes. That might be fine for tiny files, but it would be a huge performance hit for larger ones (a few megs, for example).Why not do it a bit more simply?using (FileStream str...
17 Feb 2012 by OriginalGriff
Reason for my vote of one: You want to write a virus.
1 Jun 2011 by SimpleData
Hi,I am trying to send a big file over a TCP connection using NetworkStream and TCPClient. Both the client and the server is written in C#.There is no problem while transferring small files around the size of 300KB. My buffer size is 2KB and here is how the protocol works.-Server...
1 Jun 2011 by Sergey Alexandrovich Kryukov
If you really want to keep to pure client-server paradigm, server cannot request anything. Server is purely passive. If you want to implement some inversion of control, it's fine but don't call it client and server. You application does not need it.— Client: I'm sending a file: name is...
17 Jan 2012 by Lodewijk Pool
A quick and easy way to direct Java System.out to File and to Console.
2 Feb 2012 by Member 3896609
try{ FileOutputStream fout= new FileOutputStream("stdout.log"); FileOutputStream ferr= new FileOutputStream("stderr.log"); TeeOutputStream multiOut= new TeeOutputStream(System.out, fout); TeeOutputStream multiErr= new TeeOutputStream(System.err, ferr); ...
6 Sep 2010 by Uwe Keim
Introducing a small class that helps you in creating automatic copies of files and clean them up automatically, too
4 Jan 2018 by ZurdoDev
You should contact the vendor directly to find out how to do this.
31 May 2010 by jamseyang
I want to know how to define a .proto file to store a tree struct.Thank you.
13 Oct 2012 by KevinBrady57
I just discovered that VB2010 code will not let you write to a mapped drive letter.For example if "W" is mapped to some location, the following will not work:My.Computer.FileSystem.CopyFile("C:\TEST1.TXT", "W:\TEST1.TXT", True)So, the question is, is there a method to get the absolute...
13 Oct 2012 by Dave Kreskowiak
I just discivered that VB2010 code will not let you write to a mapped drive letter.Utter bullsh*t. Yes it will. The problem is in your code or the account you're using doesn't have create/write permissions to the path the drive letter is mapped to.
12 Dec 2012 by Pyakaa
i want to access the hard disk drive of another system, whose ip and log in credentials are know to me, copy a file and send it as an attachment to my program (running in a different system...)the above has to be done using program(i.e no manual intervention)Plz let me know how to do it..
12 Dec 2012 by Sampath Kumar Sathiya
Hi,Please rerer the following link,Access remote PC's share file by UNC path with username/password[^]
15 Apr 2013 by Pyakaa
i found the answer to it, as the in-build function impersonate().this will solve the purpose
7 Jan 2014 by MichCl
I'm writing a backup program for our new server. I'm an administrator, and I'm learning a lot. The issue is that I can back up a file on the c:\ drive to the c:\ drive, but not for the drives on the SAN, like when I try to backup a file on the T drive (SAN) to the H drive (server). I tried using...
7 Jan 2014 by bowlturner
I'm going to take a guess and say you might need to use the UNC path vs. the mapped path. Here instead of Z:\PlaceIWantToAccess we often need to use \\TheServer\PlaceIWantToAccess
28 Oct 2015 by Ramiien
Hi ,I am also trying to access CAN bus data in C++. I have PCAN_USB(my hardware board connected with CAN) and I am getting heart beats which i can see from PCAN_View(PEAK systems API) but what i need to do is to save all coming CAN Data(heart beats) into a log file (pcanlog.txt) using...
28 Oct 2015 by CPallini
Well, they provide the API documentation, at least[^]. You should carefully study the API and then write your application.
29 Oct 2015 by bling
PCAN_CHANNEL_AVAILABLEPCAN_C...
12 Feb 2010 by Derek R. White
Hello.I am trying to write a Control that displays all files and folders in a specified directory. If a folder throws an UnauthorizedAccessException, I can't display that folder in my Control.I have heightened the running permissions to administrator, and have employed code that confirms...
12 Feb 2010 by #realJSOP
You shouldn't elevate permissions programatically (and I don't think Windows will allow it).
12 Feb 2010 by William Winner
There are a lot of reasons that you shouldn't show a folder if you get an UnauthorizedAccessException. Why would you want to? If you're user Jack, you want that user to be able to see the files in Judy's namespace?
12 Feb 2010 by Derek R. White
If I'm user Administrator, I'd want everyone's everything.
23 Aug 2018 by Dev O'Connor
Hi, i have a client that is trying to enforce filegroups when new databases are created. AS the admin doesnt create the database and is done by a 3rd Party Software via the 'Create Database' command, we do not have the ability to enforce it. We tried a server tigger monitoring for the create...
18 Oct 2013 by ASP.NET Community
How to add images in Image Rotator with the help of FileUpload control
11 Oct 2013 by ASP.NET Community
Howto: Add JavaScript inside Head element from code behind  Here is the sample how you can do that.1)  Add some JavaScript inside page header
6 Jun 2012 by Srinivas39
Hi Guys,I'm getting an Outofmemory Exception while loading a table into an mdb file using oledb connection. the table is having more than 6 lakh records and the file size will not 150 mb. we have that space in our server. still it is giving us exception.Can any one tell me the solution...
6 Jun 2012 by Dave Kreskowiak
You're using a DataAdapter to fill a DataTable from the SQL database, and you expect the system to hold over 6,000,000 records IN MEMORY?? How big is a single record?? Do the math...A more appropriate way to do this would be to create a SSIS (SQL Server Integration Services) job to export...
23 Mar 2001 by Wolfram Steinke
An entry level tutorial on using one of the Windows Common Controls in a dialog.
11 Oct 2013 by ASP.NET Community
Many of us want to use CSS 3.0. This feature is promised in Visual Studio 2010 however if you open any given CSS file, the option does not appear in
30 Mar 2017 by M@hdi
I've added my file into resources with right click -> existing item. Now I want to copy the added file into another directory like this:File.Copy(@"I don't know", @"C:\Users\user-1\Desktop\", true);I don't know what I have to write in @"I don't know" part to addressing the added resource...
30 Mar 2017 by Dave Kreskowiak
You can't use File methods to get at a resource. You should be using Assembly.GetManifestResourceStream. You can then just write the content, be it text or bytes, to the target file yourself.GetManifestResourceStream[^]
17 Jul 2016 by Andy Point
Android Download Manager Tutorial: How to download files using Download Manager from the Internet
3 Mar 2016 by Member 11403735
Hello. I have a program for send a file via Bluetooth but i want to send a file via Bluetooth without show Bluetooth device chooser. I already tried.Please help me
3 Mar 2016 by ali majed
This can help you Innodroid - Android Freelance Contract Software Developer[^]I wrote a program on it
13 Sep 2012 by softprga
animated gif not working in ie7.It works in other browser like firefox,crome.
13 Sep 2012 by Sandeep Mewara
It's a common issue (was I should say as we are into IE9 now!). It's a known bug (limitation) of IE. Resolution: You could use JavaScript to solve it - Preload image and change source () of freezing image to that preloaded image on "onbeforeunload" action OR place the image...
27 Apr 2013 by Khaled Mohamed El Sawy
I made a file transfer project that sends any type of files but there is a problem that the file sent is not saved , I don't know what is wrong with my code ?the file chooser opens correctly and the selection is fine but there is something wrong in the receiver cant figure it out ...This...
8 Feb 2015 by thorssig
Antivirus programs such as Comodo Internet Security have extremely cool access control to files based on program access.I'm particularly interested in how they interrupt access to files, provide a pop-up asking the user to confirm and then allow/deny access to files based on his reply.Any...
8 Feb 2015 by Frankie-C
AV software make use many different systems, some of system hooks, rootkits (i.e. kaspersky) and AV API's form MS for office products.If you want take a closer look check clamwin that is an open source AV under GNU license.About hooking there are some excellent articles here like EasyHook.
5 May 2021 by Blake Miller
I have two PML files. One from a system that 'works' and one from a system that does not. I want to compare the two PML files and find the 'differences', which could indicate why the system that is broken, is broken. There are hundreds of 'false...
4 May 2021 by Rick York
Have you had a look at these ? procmon-parser · PyPI[^] GitHub - asquigglytwist/SeeBee: A PML Analyzer.[^] This might be helpful also : The Ultimate Guide to Procmon[^]
13 May 2010 by Poonamol
Hi,I had created a file with "a+" mode.I want to write data into that file asNU2947;03/09/2004;NU2947;03/09/2004;F50359;03/06/2004;but I am gettingF50359;03/06/2004;NU2947;03/09/2004;into that file.Can anyone help me out to write duplicate data in a file.Also let...
27 May 2014 by jeffingeorge
How to append two different file formats and detach them back to its original form?
28 May 2014 by Richard MacCutchan
Create a new fileAdd a header record identifying the first file, its type and length.Read the file, and write it to the output.Add a trailer record confirming the end of the file.Repeat for any number of files.Add en and of data record confirming no more file.Close the output...
4 Jan 2011 by brsecu
Visual studio doesn't allow you to append or split files larger than 2gb. I'm trying to append a file using this method.FileStream fsSource = new FileStream(OriginalFilePath, FileMode.Append);Byte[] bytePart = System.IO.File.ReadAllBytes(Part2FilePath);fsSource.Write(bytePart, 0,...
4 Jan 2011 by Tony Richards
Have you tried opening it with an appropriate Windows API function, instead of the built in File functions. These may not have the limit imposed (or may have a documented way around it). I suggest you have a look through the Windows API documentation, find a function that may work, and then...
4 Jan 2011 by OriginalGriff
Yes it can be done - I believe, I haven't tried it (I don't have many 2Gb files lying around, and those I do I don't particularly want to but together)The problem is that you are trying to do it in a single chunk, via File.ReadAllBytes, which is (understandably) limited to 2Gb.If you...
4 Jan 2011 by Manfred Rudolf Bihy
You have to read the file you want to append to the other in smaller chunks inside a loop. There is a limit of 2GB for one process (at least on 32bit machines). So if the function were to read the whole 2GB at once the process would run out of memory.Besides that: fSource is a bit misleading...
4 Jan 2011 by Shree
Is it for your personal use or is it for an application that you are developing? If it is for an in-house purpose, you might save time using System.Diagnostics.Process.Start() to call the tool that you downloaded. If the tool doesn't support command line, you could use some other free tools....
4 Jan 2011 by ninasg11
Read this article. Hope it will benefit youSplit large XML files into small files[^]Good Luck :)
5 Jan 2011 by brsecu
Thank you everyone for your help. I always appreciate it and every answer here was a good one. I gave everyone a 5. I am using an ftp api that downloads a 5g file everynight. The api requires on fail to make a new file then merge them. This is why i had that problem. I agree its not the...
11 Oct 2013 by ASP.NET Community
App_Offline.htm ASP.NET 2.0 introduced the ability to take an application offline simply by adding a file named App_Offline.htm to the
9 Aug 2012 by Xaltus
I've been struggling with what seemed like an easy task in asp.net/c# for longer than I would like. I thought this would be easy, since I understand the syntax of C/C++, JavaScript, VBScript, and VB.Net.I have an aspx page and I would like to include a c# source file that defines and calls a...
26 Oct 2010 by Spyker55
Hi I am sitting with a problem where I am trying to write a PDF file to a folder inside of my solution e.g JunkFolder.Can any 1 please advise me on how I can do this?Anton
26 Oct 2010 by E.F. Nijboer
You would need to use Server.MapPath to get the correct folder:http://msdn.microsoft.com/en-us/library/ms524632%28VS.90%29.aspx[^]Good luck!
18 Jul 2011 by AnuguPradeep
I have created a label control in my master.aspx page....in my code behind file(master.cs) when Iam trying to use it..it's throwing error like--- "the control does not exist in the current context"..not only label any control when I try to use in .cs file it's showing 'control does not exist"...
18 Jul 2011 by Espen Harlinn
I believe this answers your question:How to: Reference ASP.NET Master Page Content[^]Best regardsEspen Harlinn
7 Nov 2017 by ddgjgj
These are the classes im working with : public partial class AttachmentFile { public string Id { get; set; } public string FileName_ { get; set; } public string Ext_ { get; set; } public int FileSize_ { get; set; } public Nullable...
2 Oct 2015 by Patrick70__
When pressing a button I have to create on client a text file, open it and then delete it. I can create and open/download it with:protected void btNotepadPending_Click(object sender, EventArgs e){ string sFileName = System.IO.Path.GetRandomFileName(); try { ...
3 Oct 2015 by F-ES Sitecore
Your code isn't creating a file on the client, it is offering the client the opportunity to download the file. You can't create files on the client and you can't delete them either. Would you want web sites creating and deleting files on your file system?
11 Oct 2013 by ASP.NET Community
When a page request is sent to the Web server, the page is run through a series of events during its creation and disposal. In this article, I will
3 Jun 2013 by bbirajdar
I have this code written to export data to excel in a click event. The export works fine except that the page is rendered blank on this button click.Can somebody tell me what I am missing in this code..??protected void btnExportPDF_Click(object sender, EventArgs e) { ...
3 Jun 2013 by Sunasara Imdadhusen
Hello,For downloading file please use public void DownloadFile(string filePath){..} from following linkASP.NET File Upload with Progress Bar[^]Thanks,
12 Mar 2014 by xprtgovind
how can i assign name of...
24 Mar 2010 by Ozgur salginci
page struct : -content---script manager----- update panel--------repeater
24 Mar 2010 by Sandeep Mewara
Ozgur salginci wrote:Width="100%" EnableViewState="False" />Looks like this is a Custom Control. What is the base control that you had used? From your page design, you have placed the fileuploaded inside the UpdatePanel. ASP.NET file upload control is not compatible with Update panel...
18 Oct 2013 by xmark1rax
Need write to file %variable%, instead of its "value". Basically what I have:@ECHO OFFSET variable=2ECHO Some text... > file.batECHO %variable% >> file.batECHO More text.. >> file.batWHAT I GET, file.bat:Some text...2More text...WHAT I WANT, file.bat:Some...
18 Oct 2013 by xmark1rax
I found a solution: Instead of %variable%, write %%variable%%.So in order to display/write one %, write ECHO %%.
18 Feb 2023 by Eddie Winch
Hi there, I have the following line of Code in a Batch File :- set "SourceFolder=C:\Users\eddyw\Desktop\PAC_PNL Misc\PAC-MISC\pacbob1940" for %%a in ("%SourceFolder%\*.PAC") do PAC-MISC.exe -d Test_Files "%%a" The Batch File runs a C...
10 Feb 2023 by Dave Kreskowiak
First, the SET statement does not need the quotes around it at all. Next, the problem is going to be with the command you're running as part of the FOR statement, or the batch files ability to find the command. Is the batch file in the same...
10 Feb 2023 by Richard MacCutchan
You have a space character in the directory path, which will cause the path passed in the for statement to be interpreted as "C:\Users\eddyw\Desktop\PAC_PNL". Try changing the set statement to the following, removing the double quote in front of...
19 Feb 2023 by l o o l
@echo off cd /d "C:\Users\eddyw\Desktop\PAC_PNL Misc\PAC-MISC" pushd "C:\Users\eddyw\Desktop\PAC_PNL Misc\PAC-MISC\Test_Files" for %%i in (*.PAC)do PAC-MISC.exe -d . "%%~nxi" popd I have a feeling that the program already handles its argument...
8 Nov 2017 by nina4ever
hi i need to copy a lot of image files (more that a thousand image, each of which is maximum 1 MB), which are stored on different machines on intranet, to a central NAS storage. i will write a C# program for that.. what is the most efficient method to do the job? is (File.Copy) enough, or...? ...
2 Apr 2011 by Du Sijun
HowdyWhat 's the best way to add a header to an existing file if the file size is around 1-2GBC++
3 Apr 2011 by OriginalGriff
1-2GB. Source? In one file? :WTF:I think you have bigger things to worry about than adding anything, even a header, to that file...
3 Apr 2011 by mbue
You can do it like mp3 (v1) files do: append a fixed size header at the end of the file.Otherwise like mp3v2-header you have to move all content of the file to make room for the header. mp3v2 reserves some extra space for changes. Thats why you must not move all the content again for minor...
3 Apr 2011 by Albert Holguin
the problem with adding the wav header to a file this big is that any player will attempt to load the entire file to memory when playing it, completely bogging down a computer, what I would suggest is first breaking up the file into fixed size blocks (lets say 256MB, with the last file...
4 Apr 2011 by funniezatee
Hi all,I am in a fix for a better solution here for my digital web shop.My situation is that I have 6 packages for sale, each containing 1GB of files on my server.These files will be uniquely watermarked before being compressed to allow fordownload by each buyer - reason to uniquely...
4 Apr 2011 by Peter_in_2780
Is there any reason you can't do the watermarking on-the-fly as you are serving the download? That way, all you need to store for more than a few minutes is stuff you're keeping anyway - customer name and watermark key. To do this, you will probably need to set up your watermarker as an external...
15 Dec 2017 by Laurie Stearn
Dialogex with Listbox to manipulate long paths in Windows
4 Feb 2018 by Member 13661441
can we use the name of the class instead of its object in the following syntax : student s; fin.read((char*)&s,sizeof(s)); where s is the object of the class. and student is the mane of the class What I have tried: Basically nothing,
4 Feb 2018 by CPallini
Yes you can. The compiler happily accetps fin.read((char*)&s,sizeof(student)); As you may easily verify. The form fin.read((char*)&s,sizeof(s)); however is more robust (if you change the type of s it remains correct).
6 Oct 2010 by Pawel idzikowski
How to serialize binary data to IsolatedStorage in a Silverlight client when there is no BinaryFormatter in Silverlight? Why not with sharpSerializer? - An open source XML and binary serializer for .NET and Silverlight
23 Apr 2010 by skt149
Hi all,I have got a problem regarding Bitmap file. To read the bitmap (256x256) file I use two dimensional array by scrip the header. for (x =0; x
23 Apr 2010 by Henry Minute
The Bitmap class has a RotateFlip method which may be of use to you (see the Help system for details) although I have to say that your whole methodology seems a little complicated.There may of course be a perfectly valid reason for this but if you were to explain what it is that you are...
8 Mar 2011 by Olivier Levrey
Simple helper classes to read/write files using BufferedStream plus a few handy methods (read/write structs or simple arrays)