Created
April 4, 2010 23:54
-
-
Save sween/355822 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [WebMethod] | |
| public string ConvertRTFtoText(String base64rtf) | |
| { | |
| // Crazy Winform in a Web Service | |
| String plainText = ""; | |
| String base64rtfs = ""; | |
| try | |
| { | |
| System.Windows.Forms.RichTextBox rtBox = new System.Windows.Forms.RichTextBox(); | |
| byte[] base64array = System.Convert.FromBase64String(base64rtf); | |
| System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); | |
| string decoded = enc.GetString(base64array); | |
| rtBox.Rtf = decoded; | |
| plainText = rtBox.Text; | |
| } | |
| catch (Exception e) | |
| { | |
| return base64rtfs; | |
| } | |
| return plainText; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment