Avatar of Bach Nguyen
Bach Nguyen
 asked on

C# - Convert URL to plain text

Hi,

I am trying to convert an URL format to plain text format by this way:

 string fileTxt = File.ReadAllText("test1.txt");

  MessageBox.Show(Uri.UnescapeDataString(fileTxt)); --> It doesn't work, it shows: oJ\x2BkTRbYHjeME72JTd\x2F\x2Fnb\x2BKt0RWeAmk8Gzw7dOc\x2FAM\x3D:1438850410112:hEj6agVToFMpYj7MufF9Qg\x3D\x3D

The content of "test1.txt": oJ\x2BkTRbYHjeME72JTd\x2F\x2Fnb\x2BKt0RWeAmk8Gzw7dOc\x2FAM\x3D:1438850410112:hEj6agVToFMpYj7MufF9Qg\x3D\x3D

If I use directly the string: MessageBox.Show(Uri.UnescapeDataString("oJ\x2BkTRbYHjeME72JTd\x2F\x2Fnb\x2BKt0RWeAmk8Gzw7dOc\x2FAM\x3D:1438850410112:hEj6agVToFMpYj7MufF9Qg\x3D\x3D")); ---> It works.


Could you let me know how to make string fileTxt = File.ReadAllText("test1.txt"); work?

Thank you!
C#.NET Programming

Avatar of undefined
Last Comment
Bach Nguyen

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Robert Schutt

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Bach Nguyen

ASKER
Thank you very much!

I got it.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy