# Help me wioth this securestring error

**URL:** <https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147>\
**Category:** Help\
**Tags:** question, activities\
**Created:** [November 25, 2019, 7:40am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147 "2019-11-25T07:40:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav07](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@Gaurav07](https://forum.uipath.com/u/Gaurav07)\
**Post date:** [November 25, 2019, 7:40am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/1 "2019-11-25T07:40:15Z")

</div>

Error I am getting is cannopt convert type object to secure string

 ![image](https://global.discourse-cdn.com/uipath/original/3X/6/8/681d258ac6d67418efac6251aaf9d636ec209c66.png)

---

<div class="post-metadata">

**Author:** ![RobertD](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/robertd/32/176862_2.png) [@RobertD](https://forum.uipath.com/u/RobertD)\
**Post date:** [November 25, 2019, 7:43am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/2 "2019-11-25T07:43:41Z")

</div>

Please see [How to use Type Secure Text - #4 by aksh1yadav](https://forum.uipath.com/t/how-to-use-type-secure-text/13381/4)  
SecureString secure\_str = new NetworkCredential(String.Empty, yourstring).SecurePassword;

---

<div class="post-metadata">

**Author:** ![KarthikByggari](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/karthikbyggari/32/430060_2.png) [@KarthikByggari](https://forum.uipath.com/u/KarthikByggari)\
**Post date:** [November 25, 2019, 7:53am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/3 "2019-11-25T07:53:52Z")

</div>

in\_Config is a dictionary and all the key/value pairs are string and objects.  
So you must convert the value to the desired type before using in the activities.

In your case, you are entering the password, so the input type should be secure string.  
Create one variable strPassword of data type SecureString and use the expression given by @RobertD

Assign Activity, `strPassword = New NetworkCredential(String.Empty, in_Config("Citrix_userName").ToString).SecurePassword`

Pass this strPassword as input to the Type into activity for Password field.

Regards,  
Karthik Byggari

---

<div class="post-metadata">

**Author:** ![Gaurav07](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@Gaurav07](https://forum.uipath.com/u/Gaurav07)\
**Post date:** [November 25, 2019, 9:10am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/4 "2019-11-25T09:10:30Z")

</div>

I should pass this strpasswod to type secure text or type into?

---

<div class="post-metadata">

**Author:** ![Gaurav07](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@Gaurav07](https://forum.uipath.com/u/Gaurav07)\
**Post date:** [November 25, 2019, 9:18am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/5 "2019-11-25T09:18:28Z")

</div>

its still printing system.secure.string instead of value

---

<div class="post-metadata">

**Author:** ![anoopap](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anoopap/32/96190_2.png) [@anoopap](https://forum.uipath.com/u/anoopap)\
**Post date:** [November 25, 2019, 10:16am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/6 "2019-11-25T10:16:43Z")

</div>

Hi @Gaurav07

Try This

```auto
new NetworkCredential("", io_Config("Citrix_userName").toString).SecurePassword

```

---

<div class="post-metadata">

**Author:** ![Gaurav07](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@Gaurav07](https://forum.uipath.com/u/Gaurav07)\
**Post date:** [November 25, 2019, 10:31am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/7 "2019-11-25T10:31:03Z")

</div>

> [@anoopap](#):
>
> new NetworkCredential(“”, io\_Config(“Citrix\_userName”).toString).SecurePassword

and the resulting value should be entered into type into or type secure text

---

<div class="post-metadata">

**Author:** ![anoopap](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anoopap/32/96190_2.png) [@anoopap](https://forum.uipath.com/u/anoopap)\
**Post date:** [November 25, 2019, 10:32am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/8 "2019-11-25T10:32:46Z")

</div>

@Gaurav07

Please use type secure text

---

<div class="post-metadata">

**Author:** ![Gaurav07](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@Gaurav07](https://forum.uipath.com/u/Gaurav07)\
**Post date:** [November 25, 2019, 10:45am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/9 "2019-11-25T10:45:13Z")

</div>

> [@anoopap](#):
>
> new NetworkCredential(“”, io\_Config(“Citrix\_userName”).toString).SecurePassword

its still printing the data type as system.secure.string and not the value

---

<div class="post-metadata">

**Author:** ![anoopap](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anoopap/32/96190_2.png) [@anoopap](https://forum.uipath.com/u/anoopap)\
**Post date:** [November 25, 2019, 10:52am UTC](https://forum.uipath.com/t/help-me-wioth-this-securestring-error/171147/10 "2019-11-25T10:52:22Z")

</div>

Hi @Gaurav07

This one is working for me  
Try to replace “Anoop” with your variable as string format.

```auto
new System.Net.NetworkCredential("", "Anoop").SecurePassword 

```

Could you please check your input string is not empty ?
