Click here to Skip to main content
15,888,802 members
Home / Discussions / C#
   

C#

 
AnswerRe: Plot line graph from database Pin
V.11-May-14 20:19
professionalV.11-May-14 20:19 
GeneralRe: Plot line graph from database Pin
Syafiqah Zahirah11-May-14 20:52
Syafiqah Zahirah11-May-14 20:52 
GeneralRe: Plot line graph from database Pin
V.11-May-14 21:01
professionalV.11-May-14 21:01 
GeneralRe: Plot line graph from database Pin
Syafiqah Zahirah15-May-14 6:53
Syafiqah Zahirah15-May-14 6:53 
AnswerRe: Plot line graph from database Pin
Bernhard Hiller11-May-14 22:14
Bernhard Hiller11-May-14 22:14 
GeneralRe: Plot line graph from database Pin
Syafiqah Zahirah15-May-14 7:13
Syafiqah Zahirah15-May-14 7:13 
GeneralRe: Plot line graph from database Pin
Syafiqah Zahirah20-May-14 9:24
Syafiqah Zahirah20-May-14 9:24 
QuestionDeleting Read Bytes Pin
computerpublic10-May-14 23:49
computerpublic10-May-14 23:49 
C#
/*To simplify the explanation of the problem, i am using a very small portion of the code which the problem occurs. While attempting to read bytes from a large file, I am getting OutOfMemory errors. I don't want to buffer, store or save the bytes I am reading. I simply want to read each byte, then discard it completely (to free up the memory and prevent getting the error) and then read the next byte and so on to the end. I am not sure of HOW OR WHERE to to do my deletion of the bytes after they are read. I have been reading about "flush" but I am not sure of how to use it or even if it will work. Can someone please assist?*/
using System;
using System.IO;
using System.Collections;

namespace Applica
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryInfo da = new DirectoryInfo("C:\\Folder");
            FileInfo[] Arr = da.GetFiles();
            if (Arr.Length == 0)
            {
                throw new InvalidOperationException("No files found.");
            }
            FileInfo ap = Arr[Arr.Length - 1];
            long Totbyte = ap.Length;
            string filePath = ap.FullName;
            string temPath = Path.GetTempFileName();
            byte[] data = File.ReadAllBytes(filePath);
            //File.WriteAllBytes(temPath, data);
        }
    }
}

AnswerRe: Deleting Read Bytes Pin
OriginalGriff11-May-14 0:49
mveOriginalGriff11-May-14 0:49 
GeneralRe: Deleting Read Bytes Pin
computerpublic11-May-14 5:58
computerpublic11-May-14 5:58 
GeneralRe: Deleting Read Bytes Pin
OriginalGriff11-May-14 6:22
mveOriginalGriff11-May-14 6:22 
GeneralRe: Deleting Read Bytes Pin
Richard MacCutchan11-May-14 7:17
mveRichard MacCutchan11-May-14 7:17 
GeneralRe: Deleting Read Bytes Pin
Richard MacCutchan11-May-14 7:17
mveRichard MacCutchan11-May-14 7:17 
QuestionHow Do I Select Particular Data From Sql Database In C#? Pin
hahaahahaahahhahahahhahaha10-May-14 18:29
hahaahahaahahhahahahhahaha10-May-14 18:29 
AnswerRe: How Do I Select Particular Data From Sql Database In C#? Pin
OriginalGriff10-May-14 21:31
mveOriginalGriff10-May-14 21:31 
QuestionUpdating UI from Task Pin
GrooverFromHolland10-May-14 5:40
GrooverFromHolland10-May-14 5:40 
AnswerRe: Updating UI from Task Pin
Eddy Vluggen12-May-14 8:31
professionalEddy Vluggen12-May-14 8:31 
GeneralRe: Updating UI from Task Pin
GrooverFromHolland13-May-14 10:31
GrooverFromHolland13-May-14 10:31 
GeneralRe: Updating UI from Task Pin
Eddy Vluggen14-May-14 7:19
professionalEddy Vluggen14-May-14 7:19 
QuestionEditing values in List? Pin
Member 1044193910-May-14 4:16
professionalMember 1044193910-May-14 4:16 
AnswerRe: Editing values in List? Pin
Wes Aday10-May-14 4:25
professionalWes Aday10-May-14 4:25 
AnswerRe: Editing values in List? Pin
pradeep surya10-May-14 5:19
pradeep surya10-May-14 5:19 
AnswerRe: Editing values in List? Pin
Member 1044193910-May-14 6:33
professionalMember 1044193910-May-14 6:33 
AnswerRe: Editing values in List? Pin
Wes Aday10-May-14 14:08
professionalWes Aday10-May-14 14:08 
AnswerRe: Editing values in List? Pin
BillWoodruff10-May-14 13:31
professionalBillWoodruff10-May-14 13:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.