Invoke code error csharp

I am trying to make a process which uploads files to page and I am creating it in C#.

In one part of the process I have used Invoke Code but this is giving me error, Could you help me please?



Could you show as error message?

Hi,

As C# is case-sensitive, you need to modify “Using” to “using” and “If” to “if” at least.

Please check your error message to identify which part is wrong.

Regards,

@Konrad_Mierzwa @Yoichi I just modified it but still gives the error:

Error ERROR Validation Error No compiled code to run
error CS1026: ) expected At line 3
error CS1002: ; expected At line 3
error CS1513: } expected At line 3
error CS1002: ; expected At line 8
error CS0305: Using the generic type ‘New’ requires 1 type arguments At line 3
error CS1955: Non-invocable member ‘WebClient’ cannot be used like a method. At line 3
error CS0103: The name ‘client’ does not exist in the current context At line 6
error CS0305: Using the generic type ‘New’ requires 1 type arguments At line 8
error CS1955: Non-invocable member ‘X509Certificate2Collection’ cannot be used like a method. At line 8 Main.xaml

Hi,

For now, can you also modify “New” to “new”?
And can you share your code as text file?

Regards,

thank you now there is no more error

1 Like

hello @Yoichi @Konrad_Mierzwa at the same project whrn I do debug, now it’s giving me this error. How to solve it please?

Hi,

It seems item variable is null. Can you check content of the item when error occurs?

If it’s null, can you try to add !string.IsNullOrEmpty as the following?

!string.IsNullOrEmpty(item) && ( item.Contains(".png") || item.Contains(".jpg") || ..........)

OR, if there is an expression behind the visible expression, please share it as text.

And as the above question is apart from title of this topic, perhaps you should create new topic because it will help those who face same issue.

Regards,