Quote:
I get error if I remove $
then the name is "{txt_CHKR.Text} {txt_PN.Text} {label67.Text}.png"
That's to be expected. With the
$
prefix, you have an interpolated string; anything enclosed in
{...}
braces will be treated as code, and inserted into the final string. Without that prefix, it's just a normal string; what you type is
(almost) exactly what you get.
$ - string interpolation - C# reference | Microsoft Docs[
^]
The "generic error in GDI+" error could mean anything. Since you've removed the interpolated string prefix, it probably means that the file doesn't exist.
You haven't told us what error you're getting with the
$
prefix. If it's telling you that
$
is not valid, then you're using an old version of Visual Studio, and you'll need to use
string.Format
instead:
... + string.Format("{0} {1} {2}.png", txt_CHKR.Text, txt_PN.Text, label67.Text)
String.Format Method (System) | Microsoft Docs[
^]
If you're getting a different error, then you need to tell us what the error is.