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

division gives infinity anser
int main()
{
int z=0;
int i=1/z;
cout<
}

It doesn't throw a

Populate drop down list from table??
Lets say for arguments sake that i have a table which contains the numbers 1 to 10.
How can i get

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

Validation
Hello

I know this is a really vag question.

I need to have a input field on a form th

phpMailer not working ..........
HI,
I was playing with the phpMailer script and tried to send a smiple mail using their test scri

CE 7.1 and External GIS integration
Hi All,

We want to develop an application on CE 7.1 which uses GIS features from an exter

Send current URL in URL with a $_GET variable problem.
Hello community,

I have created a function that gets the current variable of a page, example:

Extracting Long text from message class with parameters
Hi,

I would like to extract the long text from a message class. However, the long text ha

Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I d

Combining Two Queries
I have two scripts that each work fine by themselves. One is a search script with a variable that de

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