Click here to Skip to main content
15,889,808 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 Updated

File 

11 Jan 2010 by #realJSOP
I wouldn't do it because it's a system DLL, and Vista/Weven don't like it when you mess with system DLLs.
12 Feb 2010 by #realJSOP
You shouldn't elevate permissions programatically (and I don't think Windows will allow it).
28 Mar 2010 by #realJSOP
The problem is that you can't kill VB. Once you think it's been killed, it comes back as "something better".
1 Jul 2010 by #realJSOP
I had the code all typed out and was ready to submit, and then I realized that you were after VB6 code, so I deleted it. Tough nuts to you, bucko.Besides all that, this is a homework assigment...
6 Oct 2010 by #realJSOP
Why not just save it as XML? Here's an article that will help you save/load a simple xml data file:XML Application Profile Class[^]
30 Dec 2010 by #realJSOP
Try this:http://www.intowindows.com/change-file-type-icons-in-windows-7-with-types/[^]Apparently, changing a file's icon is problematic when you try to do it through the registry on Vista/Windows 7.
15 Feb 2011 by #realJSOP
Compatibility mode: (found this with google) http://social.msdn.microsoft.com/Forums/en/windowscompatibility/thread/bc32887d-4fcf-4416-aa22-36a93dfeb644[^]Run as administrator: (found this with google) You need to create a string value (REG_SZ) under one of these keys (if you...
28 Feb 2011 by #realJSOP
You're going to have to retrieve the date/time from each log entry to do what you want. I wrote a tip/trick that makes it easy to compare two DateTime objects for just the parts you care about:Partial DateTime Object Equality[^]
7 Nov 2011 by #realJSOP
Create a parameterized thread function that saves a file, and pass the filename to be saved, along with the data to be saved to that file. If you're getting data from multiple ports, each port receiving data should also be opened on itsa own thread, and those port threads should create their own...
28 Feb 2018 by #realJSOP
Your design is inefficient and needlessly increases project complexity. I would do it with ONE multi-threaded service that does NOT use FileSystemWatcher. The main thread would monitor the folder in question for new files (I would use React/Rx library for this). When a new file is detected,...
6 Feb 2019 by #realJSOP
I posted a tip about this a number of years ago: Resolving Paths in a Multi-Folder WebSite[^]
8 Aug 2011 by 204.sharma
Hello everyone, i need some help.i want to copy some file to another system which is a network system.all systems are connected through LAN.when i copy a file to my server system to another system it gives an error(system connot found or connot logon to system.).my code...
7 Feb 2010 by 4277480
you cant use javascript but you can use ajax.-------------------Answer 2:Use something like this: if (FileUploadControl.HasFile) { double FileSize = FileUploadControl.PostedFile.ContentLength; double VerifyFileSize = FileSize / 1024 /...
24 May 2010 by 82130012
I want to write a program to read a file and binary search in it. I don't know if this code is correct or not, please check it://size of record = 100 b//size of blonck = 4 kbstruct record{ char name [26] ; char family[30] ; char stu_no [20] ; char...
3 Jun 2013 by _Amy
I agree with Prasad in Solution 1[^]. I am adding few links which will explain you about storage option in android.Storage Options[^]Android Environment[^]--Amit
25 Apr 2022 by A v Nov2021
Input in a text file : Combination: 1 . 1 . 1 . 1 var_a: 33 op: -9.234727046103648 Combination: 1 . 1 . 1 . 2 var_a: 31 op: -9.234270216065962 Combination: 1 . 1 . 1 . 3 var_a: 39 op: -9.233204788566372 Combination: 1 . 1 . 1 . 4 var_a: 50 op:...
29 Dec 2012 by A-s-h-l-e-y
You need to make the storage type video as:{string name;string location;}and so on...So if your object is stored as a byte array it would be:video[] Video = new video[255]; This would give 256 videos. I would also recommend using lists not arrays but this is what you wanted.
23 Nov 2010 by A. F. M. Golam Kibria
Hey guys,I am creating some dll files.Is there any way so that while installing my application using that dll in clients end so that dll are located in a different directory and dll can be referenced from that directory.
8 Jan 2015 by a.alghabban
How to use WCF to stream large file size over TCP
6 Aug 2012 by Aarti Meswania
while ( 1 ) { ch = fgetc ( fs ) ; if ( ch == EOF ) break ; else fputc ( ch, ft ) ; }refer http://www.go4expert.com/forums/showthread.php?t=2977[^]Happy Coding!:)
11 Aug 2012 by Aarti Meswania
you mean to save last line no. some where and when application start retrieve that line no.,read text file's lines on by one and nothing to do till counter reaches the line no. means if counter>= line_no then add entries in databaseyou can store Line-no three ways.1. In database2. In...
7 Feb 2018 by Abdul Rahman
I need to search for all images in folders and its sub folders and if found images {with extension png jpeg gif}, Need to copy [not move] it to a specific folder. Can anyone help me? I have tried this code. Thank you What I have tried:
1 Jul 2010 by Abhinav S
You need to first split the string based on the blank spaces that you find within it and store them in an array. You will then need to check if each of the alphanumeric characters within this array are numeric or string.
25 Jul 2010 by Abhinav S
See if this[^] helps.
23 Sep 2010 by Abhinav S
The advantage of @-quoting is that escape sequences are not processed, which makes it easy to write.As an example, I cannot use \ in my string as it is an escape sequence.So I need to use a \\ which essentially means a single "\" in C# (when compiled).Instead I could use the @...
26 Apr 2011 by Abhinav S
A file setup for build action Content as shown below will not be included in the assembly. As a result whe you try to load the file using the resource manager you get an error. You might want to check out msdn for more details on build actions.
22 Aug 2011 by Abhinav S
As the error message suggests, access is denied.Make sure the target path exists and that you can access it via explorer.
10 Apr 2013 by Abhinav S
This simple example on Splitting and Merging files[^] might help you (though the source code is in C#).There is a very good article on segmented downloading at MyDownloader: A Multi-thread C# Segmented Download Manager[^].
8 Feb 2014 by Abhinav S
TryFile Upload with ASP.NET[^]http://asp.net-tutorials.com/controls/file-upload-control/[^]http://www.tutorialspoint.com/asp.net/asp.net_file_uploading.htm[^]
2 Apr 2014 by Abhinav S
Use the System.IO.File and System.IO.Directory classes.E.g.string[] files = System.IO.Directory.GetFiles(sourcePath);// Copy the files and overwrite destination files if they already exist.foreach (string s in files){ // Use static Path methods to extract only the file name...
6 Apr 2014 by Abhinav S
You can try the FAR tool[^].You might find other tools when you do a search on the internet.Note: I have never used it myself so I don't know if there are any implications.
21 Dec 2009 by Abhishek Sur
If you see Boxes in NotePad, that means it cant show the content in the Editor. Try saving the content again using Unicode, I think data is corrupted due to being saved as ANSI format. Also, Notepad dont store any Font related data. It shows the font that is chosen when configured to...
28 Oct 2022 by Abishek Samuel
I need to access the second column directly or iteratively. ```[ { "Player_no": 2, "player_name": "Warner", "team": "Aus", "age": 33 }, { "Player_no": 3, "player_name": "virat", "team": "India", "age": 30 ...
3 Nov 2022 by Abishek Samuel
Any Ideas to prevent duplicate entries in every execution of a program in a same text file. Thanks in Advance :) What I have tried: Still searching for good ideas :(
18 Dec 2014 by abrchaves
Hello everybody,I want to know how to create a .bat file to delete all files and folders older than 1 day. I created the next script, but I dont want to delete my .bat file, any suggestions?@echo off:: current folderset dump_path="%CD%":: timeset max_days=1:: remove all...
12 Dec 2015 by AdamDedanga
You find the JSON-file here: drydo.com/crawler/files/json/data.jsonScroll to the bottom of the JSON-file to find the data structure. Go back up in the file and look for position to find the column labels.This is the code I've done so far. I began to write in Javascript, although I...
27 Jan 2013 by AdityaPratapSingh
how to check upload file content type in classic asp?
6 Oct 2010 by Aescleal
If you want to save anything then streams are the answer - implement:std::ostream &operator>( std::istream &, const object & );for your class and snip, snip, Bob's yer Aunty.How difficult this will be depends on how...
5 Nov 2013 by Aescleal
A couple of things to check/try: - Check the file permissions, directory permissions and the share permissions. Windows security is a minefield of disappointment and over-complexity, it's really easy to get something wrong. - If all that lot seems okay try creating a text file on...
7 Nov 2013 by Aescleal
The most direct and relatively safe way of line editing a file is to:Open your source fileOpen a destination fileRead each line in turn from the source file: - if it's not the correct line then write the line to the destination file - if it's the line you want discard it and copy the...
27 Feb 2017 by Afzaal Ahmad Zeeshan
Windows Phone's WebView perhaps does not file upload itself — see here, File uploading not possible from inside a Webview?[^]. Maybe Microsoft did not want users to upload the content, using WebView. An alternate to this would be to use your own HttpClient object and then upload the file to...
16 Mar 2017 by Afzaal Ahmad Zeeshan
First of all, if you tried that article and it didn't work and you want to get some help then you should be asking this question right under that article — there is a forum provided there that you can utilize. Author will be more than welcome to help you out with this. I will not flag this...
17 Jul 2017 by Afzaal Ahmad Zeeshan
What you are doing (ironically) is that you are returning the same argument that was passed to the function. :laugh: What you need to do is, that you need to get the files from a directory and System.IO has everything that you need for this task. public static IEnumerable...
9 Dec 2022 by Afzaal Ahmad Zeeshan
Your question is unclear. The computer world has more than 2 things—while bit states can be only 2; 0, and 1. The concept of images and containers is the same as class and objects. You write the class in your Java file, and when that code runs,...
12 Mar 2013 by agnesn88
try this linkhttp://globalbanke.com/uploadFiles.asp?CustomName=Red
25 May 2010 by Ahmed Kahwaji
20 Sep 2011 by ahsanriaz1K
Hi,Just read line by line and token it on space using arr = strtok(buffer,' ');check the correct syntax from internet.arr will have the words.
29 Aug 2012 by ajeetgiri
how to load xml file into html to show news ticker
7 Feb 2018 by ajie1166
when I create the .chm document,it show the error on the below:I don't know why ,so I can't solve the problem,ask for help-------------------------------[Sandcastle Help File Builder, version 1.9.8.0]Creating output and working folders...Finding tools...Found Sandcastle tools in...
24 Dec 2013 by ajie1166
I get the answer :I should install the MicroSoft Html help,after install it ,the problem will be solved;and the download url:http://www.microsoft.com/en-us/download/details.aspx?id=21138[^]
28 Apr 2014 by Ajith K Gatty
Hi Johnson,You can set Limit in your Web Config where x is your max file size in KB.Good Luck
6 Mar 2010 by Alan N
Add the line fsw.SynchronizingObject = this; when you create the FileSystemWatcher. This will ensure that the events are raised on your Form's thread and the cross thread error will disappear.Alan.
15 Apr 2010 by Alan N
In response to your question about xcopyXcopy doesn't behave at all well when there is no standard input stream, which is the case when UseShellExecute is false. No error message is sent to either output stream and it just quits quietly with an exit code of zero.Setting...
1 Mar 2010 by Alaric Dailey
well if you want to store binary data, you need to change the type of your column.your md5 signature should also be changed.you are missing your schema, so you would have to define your schema before loading your data.So I fixed all that and rewrote your function for you, including...
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...
16 Jun 2011 by Albert Holguin
This shouldn't take a lot of memory unless the file gets big... in which case, don't load the entire file into memory, open the file and pull in one line at a time as needed. In this case, there's a tradeoff, loading a file into memory consumes RAM (which embedded devices don't typically have a...
28 Jan 2016 by Albert Holguin
Yes of course, sockets accept a collection of bytes, how those bytes are assembled and where they came from is not their concern, that's the application's problem.
14 Mar 2011 by Albin Abel
Not sure about third party controls. But if you are going to do it manually then you need to read the dwg, plot it on a graphics device (before that need to translate the coordinates to the drawing coordinates) then use a pdf printer, print it. pdf995 is a free pdf printer.
3 May 2017 by Alex2 101
I am reading a Text file in asp.net with c#. I want to fetch the data under 20 tag which is " BNZW0M00017DW " Content is as below {1:F01BNZWOMRXAXXX0001000001}{2:I102CBOMOMRUXACHN}{3:{113:0100}}{4: :20:BNZW0M00017DW :23:CREDIT :50K:/00410039933001 SUBAIH NASSER SALIM AL SIYABI POBOX 644 MUSCAT...
24 Jul 2010 by Alex_Lin
Dear Code Project Coordinator,I was trying to download the following zipped file fromConvertion from managed String* data type to LPCTSTRWhen I download the zipped file and tried to open it, I got error message like "The compressed (zipped) folder … is invalid." I would appreciate...
17 Oct 2012 by Alexander Schwoch
This is an alternative for "Fault Tolerance for Large Files on Cranky Hardware"
21 Feb 2015 by Alexis i
#include#include
9 Jan 2018 by Ali Al-Masry
Hey guys i am new to c++ and i`m trying to load .xml file it`s located at debug folder and "//Data/Filename.xml" how i can read it using c++ ? What I have tried: i tried using ifstream fs("//Data/Filename.xml"); but the file is always not found even if i moved it to debug folder directly ...
3 Mar 2016 by ali majed
This can help you Innodroid - Android Freelance Contract Software Developer[^]I wrote a program on it
27 Jun 2017 by ali64iust
hello dearsi want write a program like teracopy.i want get list of file that user select for copying.in tera copy when you want copy files, that program list every file that you selected.and you can cancel specific from list.i want know what API or component or other thing use...
6 Sep 2012 by Ali_100
The method is here,The file name extract which is unziped successfully, but when i goto the directory & try to delete it,but it says it is using by another program,what i got missing? public static void UnZipFiles() { ZipInputStream stream = new...
6 Jan 2013 by Ali_100
public static void ProcessDirectory(string targetDirectory) { // string[] fileEntries = Directory.GetFiles(targetDirectory, "*.jpg"); var fileEntries = Directory.GetFiles(targetDirectory, "*.jpg"); //if (photos.Count() == 0) //{ // ...
3 Mar 2014 by Ali_100
Microsoft Visual Studio Solution File, Format Version 11.00# Visual Web Developer Express 2010Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcMusicStore", "MvcMusicStore\MvcMusicStore.csproj",...
9 Feb 2011 by All Time Programming
Hello, My application uses openvpn.exe. System may have openvpn already in it and also saved to its path. I want my app to forcibly use the file that is in the application folder only. In app, if I use "openvpn --...." it uses the file that is located in Path. I wan to use the file...
15 Feb 2011 by All Time Programming
Hello, I want to run an exe file form my C# application. In Windows 7, due to compatibility issue I got to run that file as "set compatibility as Windows Vista" & "Run as Administrator" settings for that exe. How can I set these permissions from my application? Couldn't find on net...
16 Nov 2013 by Allw
hi all,i have come across a problem, and i am not sure how to solve it Google is useless for this! (i use VB.net by the way and anything other than that right now will confuse me).So i need to be able to double click on a file, this file opens the program and the program in turn opens...
8 Oct 2012 by AlternativeThought
Hi everyone,I have a simple method wich generate a file based on a view (Export.cshtml) to format data.//ExportController public ActionResult Export(string searchString, int searchOrder = 0) { var user = from m in db.Orders select...
16 Oct 2015 by Am Gayathri
How to fix 'Access to the path 'D:\Fol_x\' is denied. error while try to download file using C# code.Am trying to download code using C#. But am getting error,'Access to the path 'D:\Fol_x\' is denied. Sounds like error is simple but i couldn't i tried all the solutions which i got from...
8 Dec 2015 by Am Gayathri
How can i save a file stream to a folder as file?how to save below fs as file?FileStream fs = new FileStream(upload.FilePath, FileMode.Open, FileAccess.Read); byte[] ImageData = new byte[fs.Length]; fs.Read(ImageData, 0, System.Convert.ToInt32(fs.Length)); ...
11 Aug 2011 by amineel9
Hello, here I am stuck in a project I need to do a File Search I don't know the exact name is what someone can help me (this is vb.net) thank you
28 Dec 2010 by Amit Kumar Tiwari
See link below:Setting up Web.config to allow uploading of large files by ASP .NET applications[^]For other options see link below:http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx[^]
26 Apr 2011 by AmitDutta_Bokaro
Hi all,I have been developing a website where the requirement is to open .txt, .xml, .config files in notepad where I can edit the same and save at its original position.I have tried with System.Diagnostics.Process.Start("notepad.exe", "Filepath");but when the project is deployed the...
11 Aug 2012 by AmitGajjar
Hi,We are not sure how your application is working, but making some assumption i am giving you one solution.Assumptions 1) each text file have single log entry2) you have single text file having all data.Note : even other solutions are possible if above assumptions are...
29 Aug 2012 by AmitGajjar
Hi,Length property should not called for the directory. if you call FI.Length for directory it will gives you FileNotFoundException.Refer MSDN for FileInfo.Length[^]Thanks-Amit Gajjar
5 Oct 2012 by AmitGajjar
Hi,It seems like homework, I will not give you exact program but i will guide you.You need to read each line and count the characters, you can store hightest charecter count in one variable. If next read gives you greater characters then previously stored character then replace it...
11 Jun 2010 by amitjind
Do files opened in browser have local path?I am making a Adobe Plug-in in c++ with which I want to pass the PDF document opened in browser to my other application running on local machine. My main requirement is to pass the opened document either in form of stream or physically....
13 Jun 2010 by amitjind
Thanks for reply. I agree this problem is related to Adobe plug-in but I believe the solution lies in C++, I am not sure if adobe forum would be the right place to ask.I will do if it is.Let me again try to explain the problem.I need to save a PDF file opened in web browser but I do not know...
21 Nov 2013 by Ammar_Ahmad
I wanted to make a file management system but I need some help with it. I can't seem to figure out how to actually compare strings in C. Here is my current code:# include // for exit()# include // defines FILE//project task//ask for username and password...
20 Jun 2017 by ammu11
I am doing a project in that I am adding an image and a text.I have given an image and text and that works perfectly. but when I change the text only the image got deleted and only the text seems to appear. controller public async Task StudentList(Student student,...
8 Jul 2020 by Andre Oosthuizen
2 Questions in here if I understand it correctly - 1) Read and write to a file using vb.net - How to read from and write to a text file 2)Add data to a database table using vb.net - Insert new records into a database Not sure if the Move...
24 Jan 2022 by Andreas "PAX" Lück
Investigation of PE file modifications performed by Microsoft Detours
26 Mar 2013 by Andreas Gieriet
Change your code as follows:1) Give the Mutex the name @"Global\MyMutex".2) Call Dispose() on w after (or instead of) Close().Do the same for your other process.[EDIT]I would simplify the code as follows:public class Log{ public static Mutex m_Mutex = new Mutex( false,...
2 Jul 2011 by AndreFratelli
What do you mean you saved the files in the database? Their paths or their actual contents?Anyway, if you want to do this efficiently, you should take a look at clustering algorithms. Start here then move on to something more algorithmic.Be warned though, if this is something you know...
7 Jul 2010 by Andrew Rissing
I've personally never seen this particular issue, but I've seen code written by other developers who had to santize the value of the file stream length (probably due to the issue you are talking about).I'd approach it from two possible ways:1) Try using FileInfo.Length (e.g....
7 Jul 2010 by Andrew Rissing
You would do something like the following. I did notice your original code had an issue with the for loop not iterating over "Length / 2". So, that may have given you some of your problems as well. Plus, with this code, you'll want to verify the following:-End of file case is handled...
19 Aug 2014 by András Ferencz
Hello.I have a very important question :If i have a website : http://example.com and i have a file : http://example.com/wp-content/08/file.txt .this file contains : 1.0.0.0 and i want to change this to 1.0.1.1 but i want to keep this url and not to change the url too .Is this possible...
17 Jul 2016 by Andy Point
Android Download Manager Tutorial: How to download files using Download Manager from the Internet
14 Oct 2014 by AngelBlueSky
Hi I'm able to upload a file to Rest WCF Service along with some parameters, in this example just one.I tried to pass a Json object as parameter but is not working.So my question is:is it possible tu upload a file and at the same time an object just like I do in the following example with...
23 Jun 2014 by Anil Singh 2010
It might help you,http://www.code-sample.com/2012/02/single-and-multiple-file-upload-in.html[^]
19 Jul 2016 by Anisuzzaman Sumon
I have created a code for you try this:)using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.IO;namespace FolderSubfolderFile{ class Program { static void Main(string[] args) ...
21 Mar 2013 by Ankit_Sharma1987
Hello Friends, I m using File Directory , to bind Data List. I m Displaying My Code here: '...
2 Dec 2017 by annee a
What kind of programming language would be better/ easily to program Idea: As user after login, upload file (for example Word document) -> program change text formatting in Word document (formatting like font, font size, text colour). Different users this formatting could be different defined....