Click here to Skip to main content
15,880,891 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading and writing USB HID FeatureReports async. Pin
BigBenDk10-Feb-14 10:26
BigBenDk10-Feb-14 10:26 
GeneralRe: Reading and writing USB HID FeatureReports async. Pin
Jason Gleim10-Feb-14 10:38
professionalJason Gleim10-Feb-14 10:38 
AnswerRe: Reading and writing USB HID FeatureReports async. Pin
Bernhard Hiller10-Feb-14 21:21
Bernhard Hiller10-Feb-14 21:21 
QuestionSOAP from scratch? Pin
Antessima10-Feb-14 4:41
Antessima10-Feb-14 4:41 
AnswerRe: SOAP from scratch? Pin
jschell10-Feb-14 8:11
jschell10-Feb-14 8:11 
GeneralRe: SOAP from scratch? Pin
Antessima10-Feb-14 8:42
Antessima10-Feb-14 8:42 
GeneralRe: SOAP from scratch? Pin
jschell11-Feb-14 11:04
jschell11-Feb-14 11:04 
QuestionReadAllBytes Method of the File Class PROBLEM Pin
computerpublic10-Feb-14 4:39
computerpublic10-Feb-14 4:39 
C#
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Applica
{
    class Program
    {
        static void Main(string[] args)
        {
            long Totbyte = 0;//file length initialize to 0
            DirectoryInfo da = new DirectoryInfo("C:\\Folder");//local file on the computer
            FileInfo[] Arr = da.GetFiles();
            foreach (FileInfo ap in Arr)
                Totbyte = ap.Length;//real file length on local computer
            Console.WriteLine("Total Bytes = {0} bytes", Totbyte);//the code works great up to this point
            
            //want to set up an array for the exact file length above and read all bytes into the array
            //not sure of what I am doing below, but its not working out
            string temPath = Path.GetTempFileName();
            string temPath2 = Path.GetTempFileName();
                if (File.Exists(temPath))
                {
                    byte[Totbyte] data = File.ReadAllBytes(temPath);
                    File.WriteAllBytes(temPath2, data);
                }
        }
    }
}

AnswerRe: ReadAllBytes Method of the File Class PROBLEM Pin
Richard Deeming10-Feb-14 5:30
mveRichard Deeming10-Feb-14 5:30 
GeneralRe: ReadAllBytes Method of the File Class PROBLEM Pin
computerpublic10-Feb-14 5:45
computerpublic10-Feb-14 5:45 
GeneralRe: ReadAllBytes Method of the File Class PROBLEM Pin
Richard Deeming10-Feb-14 5:56
mveRichard Deeming10-Feb-14 5:56 
GeneralRe: ReadAllBytes Method of the File Class PROBLEM Pin
computerpublic10-Feb-14 6:27
computerpublic10-Feb-14 6:27 
GeneralRe: ReadAllBytes Method of the File Class PROBLEM Pin
Richard Deeming10-Feb-14 6:54
mveRichard Deeming10-Feb-14 6:54 
AnswerRe: ReadAllBytes Method of the File Class PROBLEM Pin
Matt T Heffron10-Feb-14 7:47
professionalMatt T Heffron10-Feb-14 7:47 
GeneralRe: ReadAllBytes Method of the File Class PROBLEM Pin
BillWoodruff10-Feb-14 21:23
professionalBillWoodruff10-Feb-14 21:23 
AnswerRe: ReadAllBytes Method of the File Class PROBLEM Pin
BillWoodruff10-Feb-14 6:37
professionalBillWoodruff10-Feb-14 6:37 
GeneralRe: ReadAllBytes Method of the File Class PROBLEM Pin
computerpublic10-Feb-14 6:51
computerpublic10-Feb-14 6:51 
GeneralRe: ReadAllBytes Method of the File Class PROBLEM Pin
Dave Kreskowiak10-Feb-14 7:14
mveDave Kreskowiak10-Feb-14 7:14 
GeneralRe: ReadAllBytes Method of the File Class PROBLEM Pin
Matt T Heffron10-Feb-14 7:49
professionalMatt T Heffron10-Feb-14 7:49 
QuestionLock Controls or Record for Add/Edit/Delete C# Pin
ahmed_one9-Feb-14 22:59
ahmed_one9-Feb-14 22:59 
AnswerRe: Lock Controls or Record for Add/Edit/Delete C# Pin
Keith Barrow10-Feb-14 1:04
professionalKeith Barrow10-Feb-14 1:04 
GeneralRe: Lock Controls or Record for Add/Edit/Delete C# Pin
ahmed_one10-Feb-14 1:13
ahmed_one10-Feb-14 1:13 
GeneralRe: Lock Controls or Record for Add/Edit/Delete C# Pin
Keith Barrow10-Feb-14 1:54
professionalKeith Barrow10-Feb-14 1:54 
GeneralRe: Lock Controls or Record for Add/Edit/Delete C# Pin
ahmed_one10-Feb-14 2:36
ahmed_one10-Feb-14 2:36 
GeneralRe: Lock Controls or Record for Add/Edit/Delete C# Pin
Eddy Vluggen11-Feb-14 8:20
professionalEddy Vluggen11-Feb-14 8:20 

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.