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

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

mysql UPDATE request not working and driving me crazy!!!
Hi,

I have been stuck on this for ages.

Quite simply I am trying to update my database

remove trailing slash from array
I have the following array which contains trailing slashes I need to remove. What is the best way to

displaying email without attracting a ton of spam
Hello,

this is maybe the wrong place to ask.
How would you display an email address on a w

Storing Values taken from a DB...
Using this code it will generate a short list from my database

<?php
mysql_connect

How to load mysql (and other) extensions into PHP
How to load mysql (and other) extensions into PHP PHP Development forum discussing coding practices,

Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.
Its a sports si

add text and number image
hi guys ..

ok see i want the user to add their name and pick a number then click get it and i

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: [Select]$setImage= 'productimages

php form help
Hey,

I use a control file to set my meta tags and titles

Here's an example
Code: &a

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