Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2008, 07:19 AM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading an RTF File

Hi,

My requirement is to read an RTF File and store the content(in string format) in database of field varchar.when i try to read the file using streamreader/filestream and convert it to string, it contains some junk data like "\0\0\0...... and so on.How do I achieve this with out using any com reference.

 
Old January 10th, 2008, 11:34 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Without seeing your code I really couldn't comment, apart from saying that the following worked fine for me.

StreamReader sr = File.OpenText(@"This is some text.rtf");
Console.WriteLine(sr.ReadToEnd());
sr.Close();

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in getting the page break in RTF file CsharpHelp Other Programming Languages 1 October 25th, 2009 05:57 AM
How to save an web page content into RTF/text file khatu_jec ASP.NET 2.0 Professional 4 November 27th, 2007 04:52 AM
Created RTF when try to open RTF, got an error not24 C# 0 March 31st, 2006 01:31 PM
How can I invoke an .rtf file with VB? aster Pro VB 6 3 February 13th, 2004 11:56 AM
Page breaks in rtf File bvprasad XSLT 0 January 19th, 2004 02:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.