Enter password without get credentials

@amaresan @bobby @Palaniyappan @loginerror

I have tried using
upass = new system.Net.NetworkCredential(“”, "”).SecurePassword

it gives error
Value of type ‘String’ cannot be converted to ‘System.Security.SecureString’.
upass is securestring type variable

check your upass’s type,if it is securestring type variable,it should not give error.

1 Like

Hi @Sakshi_Jain

Use below code to convert string to secure password

upass=new system.Net.NetworkCredential(string.empty,upass).SecurePassword

Use below code…to convert secure to string

upass=new system.Net.NetworkCredential(string.empty,upass).Password

Thanks,
Amaresan

1 Like

@Sakshi_Jain

  1. SecureString( image) to String
new System.Net.NetworkCredential(string.Empty, secureStr).Password
  1. String to SecureString(image )
new System.Net.NetworkCredential(String.Empty, varStr).SecurePassword

Make sure, you are assigning the value to secure string variable image

Is anyone is getting this error ?

Error ERROR Validation Error BC31424: Type 'System.Net.NetworkCredential' in assembly 'b6b727f1-47d9-4b4f-a171-53df40ce3258, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' has been forwarded to assembly 'System.Net.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Either a reference to 'System.Net.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is missing from your project or the type 'System.Net.NetworkCredential' is missing from assembly 'System.Net.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

This error basically occurs due to version issues so try updating the packages to the latest version and keep the runtime rule as lowest applicable version and the issue will be resolved.

If possible please create a new topic @indiedev91

Regards

1 Like

yes i did that and it worked

1 Like