C - Reading a file into a byte array


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I'm trying to read a file into a byte array in C. I have to use C as this is for a loadrunner script which is based on the C programming language
The .Net code from the developers I'm basically trying to simulate in C is below. I'm not a C programmer but have done some basic C programming as required in my loadrunner scripts so this is a bit out of my depth. Any help would be very appraciated
Did you know?Explore Trending and Topic pages for more stories like this.

Thanks

/// Loads the file to the upload request.

///

/// The upload document request.

/// Name of the file.

///

private void LoadFileToUploadRequest(UploadDocumentRequest uploadDocumentRequest, String fileName)

{

if (File.Exists(fileName))

{

FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);

BinaryReader br = new BinaryReader(fs);



uploadDocumentRequest.Data = br.ReadBytes((int)fs.Length);

}

}
No comments posted yet

Your Answer:

Login to answer
334 Like 10 Dislike
Previous forums Next forums
Other forums

ORA-01017: invalid username/password; logon denied
Dear All,

I am facing problem in taken backup from db13 it comes up with the following l

The page should be expire when cilck back button
hi,
i'm new to php world.
i create user registration page.
when i submit it,data goes to my

Recognising Revenue daily
Hello.
Has anyone come across daily recognition of deferred income?
We want to implement R

Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn

How can you detect variable string in a massive string?
Ok guys, i need some help with this one.

I am going to be getting a large string, like 10-20

Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c

Different payment methods with different cross company requirements in F110
We are implementing SAP in a company in the shipping industry. They have the following requirement:<

How to insert random unique values in 2 columns ?
I have table with 2 columns

Create Table code_for_code (
first_code varchar2(10) uni

Javascript form submit and radio buttons?
When this form is submitted, it is automatically resubmitted using JS.

All my fields are carr

Calander layout
Hi i know this sounds like a simple question but i cant find the answer to it anywhere i have added

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash