Click here to Skip to main content
15,897,891 members
Everything / Read/write

Read/write

read/write

Great Reads

by johnniealan
ArcNet Protocol basics
by Sujith Karivelil
This article will help you to create, update and delete events/ appointment in google calendar from your web application.
by Edgar Maass
Open and display point clouds using a simple user control. Technology used: C# and the OpenGL library via the OpenTK port to .NET.
by Debopam Pal
Create/Read/Write Advance PDF Report using iTextSharp.DLL in Desktop, Mobile, Web Application

Latest Articles

by johnniealan
ArcNet Protocol basics
by Edgar Maass
Open and display point clouds using a simple user control. Technology used: C# and the OpenGL library via the OpenTK port to .NET.
by Afzaal Ahmad Zeeshan
This article uses the MVC framework for building Java-based applications for desktop or for enterprise solutions.
by Sujith Karivelil
This article will help you to create, update and delete events/ appointment in google calendar from your web application.

All Articles

Sort by Score

Read/write 

21 Nov 2013 by nv3
Your input file does probably consist of multiple line, each containing a username and password (probably encoded with a hash function). So perform a loop over the lines in your username.txt file. In each loop iteration:a) extract the username and password out of that lineb) compare the...
17 Nov 2014 by den2k88
The thing I see is that you're not closing the file after having it scanned the first time. So what happens?The first time you cycle through the file you go right until the END OF FILE, and the internal read pointer of the FILE structure points there. Then you try to read other t_size number...
22 Jul 2018 by Jochen Arndt
The data received handler is executed in another thread. That is why you have to use Invoke to update the content of your text box from. Similar applies to the DataToSetandGet variable used there to store the received string. You can't use it from other threads (like the GUI / main thread as in...
17 Nov 2014 by den2k88
while ( fscanf ( fp, "%d", &value) == 1) // read one integer { o++; // this loop will continue until EOF or non-integer input }now you're at EOF if ( o > t_size) // If the second line of the file...
28 May 2016 by CHill60
It's not as easy as you think it should be!Firstly - avoid using the syspermissions table - use the sys views instead. syspermissions will be removed in later versions of SQLThere is a very popular solution on this link (solution by "Jeremy") SQL Server query to find all...
25 Apr 2017 by Dave Kreskowiak
Well, you can make it a tiny bit faster by replacing that string concatenation with a StringBuilder. Why? Because strings in .NET are immutable. Once created you cannot change them. What you're doing with that concatenation is creating a new string object every time you append something to it. ...
19 May 2017 by OriginalGriff
Start by checking your save file with a hex editor, and making sure that what you think it contains is exactly what it does hold. Until you have made completely sure that the file that your readFile function is processing is complete, valid, and perfect, you can't even begin to debug the...
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...
6 Feb 2014 by Sergey Alexandrovich Kryukov
In your code, you are skipping some time from read data, so what do you want? Run it under the debugger and see if you are skipping something you want to keep. :-)—SA
3 Jul 2014 by Sergey Alexandrovich Kryukov
It depends on what and how you want to read/write to/from this file. In most cases, these alternatives are much: better binary/text readers/writers. Please...
16 Oct 2014 by EdisonMecaj
I'm not a pro in code writing and C# programming. I wrote a simple app to read from process memory using the ZeraPain script ReadProcessMemory(). Is working good with the 4 bytes and 8 bytes value. The other function of this App is that can read strings, but i really need to read Double values...
16 Mar 2015 by Member 11512503
i want to read the string from key board and display it in another window in opengl
16 Mar 2015 by CPallini
GLUT providea a cross platform mechanism to handle keyboard input (see, for instance "keyboard input"[^]). If you don't want to use GLUT then you have to deal with the specific API of your favorite platform (or use another cross-platform library).
21 Apr 2015 by Member 11325219
i write a server in java that sending images for phone and reading data from it at the same time, the phone sending the position of touch and the problem that stuck on read if there is no touch on the phone, and it's been very slowllyprivate void whileConnecting() throws IOException,...
21 Apr 2015 by BacchusBeale
I would create two sockets with different port numbers, one for the images and other for receiving the data.
20 Jul 2015 by Member 11849526
I'm trying to write a python script which reads data from one csv file and based on that data it picks up the data from another csv file and writes it in third csv. However, the csv.reader() doesn't seem to work. It always returns
27 Dec 2015 by Sergey Alexandrovich Kryukov
venkat28 wrote:@sergey. Will the code above code for work for reading a filename and its contents from client and send it to server, in the desired location in the server. If u find any errors, kindly guide me.Let's start with the first one:char *str="/home/sosdt009/Documents";You are...
28 May 2016 by mousau
Hi All I need to create on repository on an etl tool.For that i got to review the permissions over the database for the user sa(read and write access) I tried the following codes:-What I have tried:SELECT DATABASEPROPERTYEX('TestProfiler', 'Updateability')Op:...
13 Jun 2016 by Dave Kreskowiak
Your code makes some assumptions, such as it has no idea if anything was returned by .getResourceAsStream(csvFileName). inputStream could end up being null and you wouldn't know it until the code crashed.Your code doesn't check to see if the file exists before trying to open it.Your code...
14 Jul 2016 by vimal265
I have wondering for a way to export and append data-table to existing excel file using C# and OpenXml. I am generating product report sheets and getting problem in Saving that new data. After append a new row successfully, when I read Excel again or Open that particular Excel file I cannot find...
14 Jul 2016 by vimal265
c# - How to export datatable data to existing excel sheet file - Stack Overflow[^]
22 Aug 2016 by njammy
Try TXTextControlText Control - .NET Reporting and Word Processing Components for Developers of Windows, Web and Mobile Applications (TX Text Control) | www.textcontrol.com[^]
22 Aug 2016 by Patrice T
You should explain in detail what you want to do becauseQuote:i wish it can open 10mbytes or bigger files. is unrealistic.Anything with such a file will be sloooow.
16 Feb 2017 by Member 10188842
Greetings, I'm a old time VBA and Basic programmer. I need a assist with opening and closing files in VB.NET. The CSV and the code is below. Can someone assist me with converting this to VB.NET. I will appreciated it. Thanks...
15 Feb 2017 by Ralf Meier
For example like this :Imports System.IOPublic Sub LoadData() Dim myFile As String = "c:\Data\myFile.DAT" Dim fs As FileStream = Nothing Dim CSV As StreamReader = Nothing Dim rowdata As String Try ' open the File ...
16 Feb 2017 by Richard Deeming
Reading and writing files in VB.NET is significantly different to VB6 / VBA. It's probably closer to the FileSystemObject[^], which was the only way to read and write files from VBScript.MSDN has some good documentation:How to: Read From Text Files in Visual Basic[^]How to: Write Text to...
9 Apr 2017 by CHill60
Convert the byte array to a string before assigning it to the label text: Label2.Text = System.Text.Encoding.Unicode.GetString(MemoryModule.ReadMemory(&H234BFD4, AscW((ChrW(0)))))
16 May 2017 by RickZeeland
It would probably be easier to use a BindingList and serialize to XML. Here is an excellent example: A Detailed Data Binding Tutorial[^] If you want information about serializing to XML, see: [^] Example: using System.Xml.Serialization; public static void TestSerialization() { myClass...
16 May 2017 by Member 13205498
using System; using System.Xml; namespace ReadingXML2 { class Class1 { static void Main(string[] args) { string name, name1; int num, i; Console.Write("Number Of Student Details = "); num =...
19 May 2017 by Member 13210661
I have problem with reading bin file to binary tree. `SaveFile` function is not probably fine but the `readFile` function is the problem.For example,I save 3 nodes to the .bin file, and when I read the file back , A node that I did not write to file shows up.I mean there is a node added to the...
19 May 2017 by Jochen Arndt
You did not show us the most important code part: The definition of your Node class. This indicates that Node.data is of type Person: file.write((char*)&root->data,sizeof(Person)); When the Person class contains any members that are pointers to allocated memory, writing and reading the way...
28 Aug 2017 by orgilhp
Now I'm using code below. But this code notifies me only when I plug in or out USB printer. But I need to get notified when printing occurs on USB printer. I am using c# and .netfx4.5. Please help me, any suggestion would be highly appreciated! Regards, Orgil.D What I have tried: using...
28 Aug 2017 by Jochen Arndt
You have to monitor the Windows print jobs and check if your USB printer is the output device. Some links which might be helpful: Monitor jobs in a printer queue (.NET)[^] A simple approach for controlling print jobs using WMI[^]
19 Aug 2018 by JimB_
when a click button open port this button set the baud settings, set port name to connect with device, and create evendhandler to send command and receive data responds from port as follow serialPortForApp.DataReceived += new SerialDataReceivedEventHandler(SerialPortInApp_DataReceived); ...
7 Aug 2018 by JimB_
hi every one I solve this by using Enums I create a (public enum AppButtonState : byte) and I declared that call in my SerialPortInApp_DataReceived event. So every time a button send a command this is first assessed by the enum. It creates an independent call for each command that I want...
25 Mar 2019 by Member 12278335
I have written a Win API application. To read the Serial port Data. It was Work Fine in Console application without any trouble. When i try it on win32 gui application its dosent work fine some time it reads few chars only some time its read complete buffer... Why its happens... Those data i...
25 Mar 2019 by Rick York
Two things look odd to me. First, your output messages say there are x bytes to read but you never display that many bytes that were read. What does that really mean? Maybe you should do a hex dump of them or something like that. Second, I have never used overlapped I/O. I always set the port...
12 May 2019 by OriginalGriff
Start by reading the excel file - I use this: C# How To Read .xlsx Excel File With 3 Lines of Code[^] That'll give you the data, and then it's pretty much trivial to get it into a DB.
17 Dec 2019 by tara lara
Hi. I wanted to learn about reading and writing files in C++. To understand it better I wrote the code below. The code below allows a user to create their own text file. After that, they can write information in it. Lastly, the contents of the file will be printed on the console. Here is the...
17 Dec 2019 by Rick York
I don't see a problem in the code immediately. Therefore, I have a suggestion for you. Comment off all of the code that prompts and acquires input and do all of that yourself with pseudo-random values. What I mean is come up with the name of a file by yourself and use that. Open the file as...
17 Dec 2019 by tara lara
Thank you for the added information. I see what you mean. I guess I need to learn how to use my debugger. Also, because I am still a college student learning about coding I did not know you could put constraints in your code! I though that only applies to Databases (Ex: writing constraints for a...
11 Jun 2020 by Nagavarsha Jasti
Hello, I'm looking for open source library to read & write very large excel files.Currently we are using EPPlus ,but they started to charge from the new release.So im looking for similar plugin which performs as good as EPPlus but should be open...
12 Jun 2020 by #realJSOP
I use a parser called ExcelDataReader. It's available via NuGet. Depending on the size of your files, it still may not be adequate, though. You'll have to make that determination on your own. EDIT ======================== I wrote an article and...
30 Apr 2021 by Yokeswaran Gandhimohan
Hi All, I am using XlSX.Read Javascript API to upload excel file, while trying to upload the excel file i need to un protect or remove the password, or any other way to un protect or input the password in Javascript, i have attached the code...
27 Jan 2015 by Sujith Karivelil
This article will help you to create, update and delete events/ appointment in google calendar from your web application.
17 Aug 2016 by Edgar Maass
Open and display point clouds using a simple user control. Technology used: C# and the OpenGL library via the OpenTK port to .NET.
27 Nov 2013 by Debopam Pal
Create/Read/Write Advance PDF Report using iTextSharp.DLL in Desktop, Mobile, Web Application
27 Dec 2015 by Garth J Lancaster
ok, obviously you love re-inventing the wheel, you could use FTP for this .... what I would do is send a fixed size packet to start with, containing information for the server side - you may have things like Filename - 512 bytesFile Size - 4 bytes long int ?CRC - x bytes the server...
24 Feb 2015 by Afzaal Ahmad Zeeshan
This article uses the MVC framework for building Java-based applications for desktop or for enterprise solutions.
6 Feb 2014 by baliram bhande
problem is like that when i read file and i perform some operation on that and write that file but when i read 50 page when i write again i got only 47 page please suggest what can i do. my code bellow.public class DataSeperation { public static void main(String[] args) throws...
14 Jun 2015 by Jean-Pierre Carvalho (JPCarvalho)
Hi,I have a card reader for read a user card but reading appears that:For user 7196: %00007196_ç00007196_ - this is a new cardFor user 910202: ç00910202_ - this is a old cardAnother card reader appears:For user 7196: 00007196 - this is a new cardFor user 910202: 00910202...
27 Dec 2015 by venkat28vk
Hi,I want to send a file from client to server using tcp/ip, along with its file name. How to achieve the above task. I have developed the code and i have used string token. I am giving the code for reference. #include #include #include ...
22 Aug 2016 by brockeu
i want to make Textviewer. this show Two pages. like book!!so i want to know. how to make page (string[] array or list).and i wish to use graphics.drawstring or textrenderer. not textbox control.because i already make it use with textbox. but it is too slow loading and resizing.i...
17 Nov 2014 by GeorgeGkas
Problem solved! .........................
3 Jul 2014 by Member 8078971
I need to change my code because I have some problem with it, and I need a replacement for the FileOpen function.Do you know what could I use insted of FileOpen function ?I thinked to writeline function but I don't know how to use it, because I need to import some option into the output (I'm...
13 Jun 2016 by Member 12581170
I have method written for downloading files from server and saving it to the classpath of the project. I can see the files in project folder after its been downloaded. But when I call read method on the files I get exception. So when I terminate the execution in between (the files are still in...
9 Apr 2017 by SDHP442
Update: i'm able to change the name but not read it.. i get this error (WHEN READING THE MEMORY): Error 1 Value of type '1-dimensional array of Byte' cannot be converted to 'String'. What I have tried: Public Shared Function ReadMemory(Of T)(ByVal address As Integer) As T Return...
25 Apr 2017 by dravoss
Hello , i want a very faster way to filter all emails that end with a special caracter in a big text file (more than 200MB) using c# What I have tried: var lines = File.ReadAllLines(file path); foreach(var line in lines) { if...
16 May 2017 by Member 13205498
Hi, everyone I want to store user's multiple data in xml using c# but when user gives Multiple data only the last data is stored to the xml file. It's overwritten on existance record. What can I do to store multiple user's data ?? So help me guys to solve this problem. What I have tried: ...
11 Apr 2018 by Member 12160120
i want to add new element for existing xml file programmatically.. i tried this code, which it is work but it doesn't do any change in my xml file. hope you help me thanks in advance What I have tried: Private Sub newnode() Dim file As String = Server.MapPath("note.xml") Dim xmlDoc...