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


Your expression seems no problem.

Can you try the following sample? (2.9 KB)

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


Hi @sangeethaneelavannan1 I’m getting below error

A - variable type is —

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


Yes. it will also work in VB.


1 Like

@Yoichi thank you

1 Like

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