How to convert string into Secure string in C#

Hi Everyone, i want to convert my string into secure string it is showing me an error. can anyone help me on this.
I’m trying below code but this is not working

Assign = new System.Net.NetworkCredential(“”, “mystring”).SecurePassword

(new System.Net.NetworkCredential(“”, “myString”)).SecurePassword try this

Hi,

Your expression seems no problem.

Can you try the following sample?

Sample20221208-8CSnet.zip (2.9 KB)

If this works, can you try to find difference b/w this and yours?

Regards,

Hi @sangeethaneelavannan1 I’m getting below error

A - variable type is — system.security.securestring

Thanks @Yoichi It worked.

i think i have used wrong quotations(“”) i guess is that right or any other difference.

Can i use same code for “Vb” type flows also or anything i need to change

Hi,

Yes. it will also work in VB.

Regards,

1 Like

@Yoichi thank you

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.