2
나는이 코드 조각을 사용하여 일반 텍스트로 RTF에 문자열을 변환하여 RichTextBox를 사용하고 있습니다에에서 OutOfMemory가 발생합니다 :를 RichTextBox는 푸른
private string ConvertToText(string rtf)
{
if (string.IsNullOrWhiteSpace(rtf)) return string.Empty;
if (!rtf.Contains("{\\rtf")) return rtf.Trim();
using (var helper = new System.Windows.Forms.RichTextBox())
{
helper.Rtf = rtf;
var plainText = helper.Text;
if (string.IsNullOrWhiteSpace(plainText)) return string.Empty;
return "<< Rule in Rich Text Format converted to Plain Text >>\n\n"
+ plainText
+ "\n\n<< Rule in Rich Text Format converted to Plain Text >>";
}
}
그것은 모든 개발자 기계에서 확인을 작동하지만,이 경우 작동하지 않습니다 푸른 웹 사이트에 배포 :
는{
"$id" :"1",
"Message" :"An error has occurred.",
"ExceptionMessage":"Out of memory.",
"ExceptionType" :"System.OutOfMemoryException",
"StackTrace" :"
at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)\r\n
at System.Drawing.Font.GetHeight()\r\n
at System.Drawing.Font.get_Height()\r\n
at System.Windows.Forms.Control.get_FontHeight()\r\n
at System.Windows.Forms.TextBoxBase.get_PreferredHeight()\r\n
at System.Windows.Forms.TextBoxBase.AdjustHeight(Boolean returnIfAnchored)\r\n
at System.Windows.Forms.TextBoxBase.set_Multiline(Boolean value)\r\n
at System.Windows.Forms.RichTextBox.set_Multiline(Boolean value)\r\n
at System.Windows.Forms.RichTextBox..ctor()\r\n
at ... "
}
이 에 상관없이 크기 RTF 문자열의 발생합니다. 이미 System.Windows.Forms
참조의 "로컬로 복사"속성을 사용하고 있습니다. 누구든지 RTF와 Azure를 다룰 수있는 경험이 있습니까? RTF를 일반 텍스트로 변환 할 수있는 대안이 있습니까?
하늘색 부분에서 더 구체적 일 수 있습니까? 어떤 종류의 하늘색 서비스를 사용하고 있습니까? 가상 기기? 웹 역할? 웹 사이트? –
웹 사이트, Thiago. –
틀릴 수도 있지만 드로잉 컨텍스트가 없으므로 하늘색 웹에서 양식의 컨트롤을 만들 수 없다고 생각됩니다. – Gusman