Saving RichTextBox contents as text
Saving RichTextBox contents as text
Hi.I'm running PF 1.1.10, and trying to save the contents of a RichTextBox to a text file. I have got all of the method info from the MSDN page, but can not find out how to represent the 'RichTextBoxStreamType.PlainText' value. RTF works fine, but I don't want to save log files to RTF format.Code:$sfd1.DefaultExt = "*.txt"$sfd1.Filter = "Text Files|*.txt"$sfd1.CheckFileExists = $false$sfd1.InitialDirectory = $txtDefaultOutputFolder.Text$sfd1.ShowDialog()$strTmpFileName = $sfd1.FileName$txtProgress.SaveFile($strTmpFileName, RichTextBoxStreamType.PlainText)Tom
Saving RichTextBox contents as text
To order to use enumerators or any static member in PowerShell you have to use the following format:
[System.Windows.Forms.RichTextBoxStreamType]::PlainText
PowerShell also allows you to specify enumerators by text name only, but you will not get the benefit of PrimalSense.
$txtProgress.SaveFile($strTmpFileName, "PlainText")
David
[System.Windows.Forms.RichTextBoxStreamType]::PlainText
PowerShell also allows you to specify enumerators by text name only, but you will not get the benefit of PrimalSense.
$txtProgress.SaveFile($strTmpFileName, "PlainText")
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Saving RichTextBox contents as text
David,Thanks for that. It'll also help me make sense of converting other MSDN C# examples in the future.Tom