TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tom jones
NA
18
11.1k
Converting Byte Array to Integer Array
Feb 11 2014 10:11 AM
//I AM TRYING TRANPOSE ALL THE BYTE ARRAY VALUES INTO INTEGER VALUES IN THE INTEGER ARRAY
//THE LAST LINE DOES NOT WORK
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;
string filePath = null;
DirectoryInfo da = new DirectoryInfo("C:\\Folder");
FileInfo[] Arr = da.GetFiles();
foreach (FileInfo ap in Arr)
{
Totbyte = ap.Length;
filePath = ap.FullName;
}
string temPath = Path.GetTempFileName();
byte[] data = new byte[Totbyte];////////////////////////BYTE ARRAY
if (File.Exists(temPath))
{
data = File.ReadAllBytes(filePath);
File.WriteAllBytes(temPath, data);
}//I AM TRYING TRANPOSE ALL THE BYTE ARRAY VALUES INTO INTEGER VALUES IN THE INTEGER ARRAY
int[] arry = new int[Totbyte];////////////////////////INTEGER ARRAY
for (int count = 0; count < data.Length; count++)
{
arry[count] = Convert.ToDecimal(BitConverter.ToInt(data,count));//THIS LINE DOES NOT WORK
}
}
}
}
Reply
Answers (
1
)
how to set fix day and month but year is selected from cmbbo
Binary File Read and Split and Convert