Home > Back-end >  Convert the string data into an array
Convert the string data into an array

Time:07-28

Below i'm storing sensitive data in string but i want to keep it array to make it more secure how can I convert that.

 stringName = $"Server={secretProps.host};Port={secretProps.port};database={_db};User Id={secretProps.username};Password={secretProps.password};convert zero datetime=True";

CodePudding user response:

If you want to store a string in an array, you can make an array, and add that string to the array, or initialize an array with these values or, you could split this string where there are ";", and Split() gives back an array.

I am not sure what is your intention, but you could look up microsoft docs about storing sensitive data in other ways.

CodePudding user response:

as above, if you want to split the string into array you can use the string.split() function for secure strings see

https://docs.microsoft.com/en-us/dotnet/api/system.security.securestring?view=net-6.0

  •  Tags:  
  • .net
  • Related