Link to home
Start Free TrialLog in
Avatar of deanlee17
deanlee17

asked on

string format

Hi guys,

Ok so I need to pass a string variable in the following format...

@"\\myserver\\folder1\\Customer Data\\sample.png"

To get the location im using

string SomeFilename = Convert.ToString(dgr_CountImages[dgr_CountImages.SelectedIndex, 3].Text);

So in theory I then need to do...

@"SomeFilename "

But obv thats not possible as it doesnt read the variable as a path name. How is this possible?

Thanks,
Dean.
SOLUTION
Avatar of santhimurthyd
santhimurthyd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of deanlee17
deanlee17

ASKER

What I am really trying to do is get the string as an image location, i.e

  string SomeFilename = Convert.ToString(dgr_CountImages[dgr_CountImages.SelectedIndex, 3].Text);

CountPartImage.Source = new BitmapImage(new Uri(@SomeFilename, UriKind.Relative));
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial