Cleanup c# code to read in a very simple data file

Completed Posted 7 years ago Paid on delivery
Completed Paid on delivery

I have some c# code I am looking to have cleaned up / simplified. All this code needs to do is read some values into a a simple data structure. Looking for best practice on naming conventions etc. Data file attached.

public struct defbulk

{

public string Description;

public float Density;

public float Repose;

public float Abrasive;

public static defbulk CreateInstance()

{

defbulk result = new defbulk();

[login to view URL] = [login to view URL];

return result;

}

}

internal static void LoadMaterial()

{

int i = 0, count = 0;

string a = "";

try

{

[login to view URL](1, [login to view URL]([login to view URL]) + "\\[login to view URL]", [login to view URL], [login to view URL], [login to view URL], -1);

[login to view URL](1, ref count);

bulk = new defbulk[count];

[login to view URL] = new string[count];

for (i = 0; i < count; i++)

{

[login to view URL](1, ref bulk[i].Description);

[login to view URL](1, ref a);

bulk[i].Density = (float) [login to view URL](a);

[login to view URL](1, ref a);

bulk[i].Repose = (float) [login to view URL](a);

}

[login to view URL](1);

}

catch

{

string msg = "";

msg = [login to view URL]([login to view URL]) + "\\[login to view URL]" + " could not be found or is corrupt. This must be corrected for the program to load. Please contact HT for assistance.";

[login to view URL](msg, [login to view URL]);

[login to view URL](0);

}

}

C# Programming

Project ID: #11891088

About the project

12 proposals Remote project Active 7 years ago

Awarded to:

JPGalaverna

I have over than five years experience with code engineering and development support, specially working with file management. If you allow me, I can deliver exactly what you expect.

$15 USD in 1 day
(1 Review)
0.4

12 freelancers are bidding on average $24 for this job

khp31

Sr. Software Developer having 7 years experience. Sr. Software Developer having 7 years experience. Sr. Software Developer having 7 years experience. Sr. Software Developer having 7 years experience.

$66 USD in 3 days
(42 Reviews)
5.9
sheikDev

Hello, I'm interested to work on this. please message me. Thanks

$15 USD in 1 day
(63 Reviews)
5.7
hasanjack

Hi sir I am Hasan Jack and I have more than 5 years of experience in C# Development. As because of my prior experience I really feel I can be best choice for this job. Looking forward to hear from you. Regards, More

$15 USD in 1 day
(6 Reviews)
4.2
johnosullivan

A proposal has not yet been provided

$30 USD in 1 day
(14 Reviews)
4.0
hammad143

Hi, I'm a C# developer you can see some of my work no my profile. I can do this job right now. If you select me I'll write you a very clean and commented code. Let's start if you wish :)

$20 USD in 0 days
(0 Reviews)
0.0