|
The question is, how is the HTML data formatted? What type is the HTML data, in your .NET code? If it's binary, you'll need to convert it from byte[] to string using System.Text.Decoder and its derivatives.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Your problem is you are interpting the "normal data" to mean "string" which if it is in the form of Html *is not* string at all. After all, this page is all Html and it has far more stuff than just "string". So what is it that you are really after? If you just want to do raw text processing you might want to look at WebRequest /WebResponse instead.
|
|
|
|
|
|
Hi,
StringParser is very good.
but there is no constant html data. html data will comes differently.
how to convet this.
regards
GV Ramana
|
|
|
|
|
I don't understand the sentence "there is no constant html data. html data will comes differently". But if you want an HTML-free version of a string that contains HTML, do this:
string strWithHtml = "...";
string strWithoutHtml = StringParser.removeHtml (strWithHtml);
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
sounds good.
ravi, really ur parser is very good.
plz send me links of other articles by you.
regards
GV Ramana
|
|
|
|
|
Hi,
I'm trying to insert a watermark witha a Word Add-in. I'm using a variant
of Paul Stubbs code that i found from a Google. The method I'm using is as
follows:
private void addWatermark(Word.Document doc, string WatermarkText)
{
doc.Application.ActiveWindow.View.Type = Word.WdViewType.wdPrintView;
doc.Sections[1].Range.Select();
doc.ActiveWindow.ActivePane.View.SeekView =
Word.WdSeekView.wdSeekCurrentPageHeader;
Word.Selection Selection = doc.Application.Selection;
Word.Shape wmShape;
//Create the watermark shape
Object missing = Type.Missing;
wmShape = Selection.HeaderFooter.Shapes.AddTextEffect(
Microsoft.Office.Core.MsoPresetTextEffect.msoTextEffect1,
WatermarkText, "Times New Roman", 1,
Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoFalse,
0, 0, ref missing);
//Set all of the attributes of the watermark
wmShape.Select(ref missing);
wmShape.Name = "PowerPlusWaterMarkObject1";
wmShape.TextEffect.NormalizedHeight =
Microsoft.Office.Core.MsoTriState.msoFalse;
wmShape.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse;
wmShape.Fill.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
wmShape.Fill.Solid();
wmShape.Fill.ForeColor.RGB = (int)Word.WdColor.wdColorGray25;
wmShape.Fill.Transparency = 0.5f;
wmShape.Rotation = 315.0f;
wmShape.LockAspectRatio = Microsoft.Office.Core.MsoTriState.msoTrue;
wmShape.Height = doc.Application.InchesToPoints(2.82f);
wmShape.Width = doc.Application.InchesToPoints(5.64f);
/*
wmShape.WrapFormat.AllowOverlap = -1; //true
wmShape.WrapFormat.Side = Word.WdWrapSideType.wdWrapBoth;
wmShape.WrapFormat.Type = Word.WdWrapType.wdWrapNone; //3#
*/
wmShape.RelativeHorizontalPosition =
Word.WdRelativeHorizontalPosition.wdRelativeHorizontalPositionMargin;
wmShape.RelativeVerticalPosition =
Word.WdRelativeVerticalPosition.wdRelativeVerticalPositionMargin;
wmShape.Left = (float)Word.WdShapePosition.wdShapeCenter;
wmShape.Top = (float)Word.WdShapePosition.wdShapeCenter;
//set focus back to document
doc.Application.ActiveWindow.ActivePane.View.SeekView =
Word.WdSeekView.wdSeekMainDocument;
} // end addWatermark
The problem i have is that I get an exception at line:
wmShape.WrapFormat.AllowOverlap = -1;
this excpetion indicated that the method or property is not available
because the drawing operation cannot be applied to the current selection?????
Any help greatly appreciated!!! Thnx, tc
|
|
|
|
|
I'm getting very often but not always some kind of error dialog when I quit my app in C# that uses some COM objects. Unfortunately I can't tell what it is because when it pops up the application closes in like 10th of a seccond and I can't see what's the dialog about. This is release build. Debug doesn't report anything in debugger on exit ever. I understand it's very vague but I still need help and hope someone here can help me. How to catch the error?
Thanks a lot for help in advance!
|
|
|
|
|
Hi!
Have you tried catching a ThreadException in your main thread?
Could be worth a try...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Yeah. But exception seems to pop up after main - when GC is collecting - i'm thinking - and there's no way to trap that.
|
|
|
|
|
It is possible to set a break point at the bottom of your main on Closing for the main form. Or if worse comes to worse, create a temporary button that behaves like "Quit" with your break point there.
|
|
|
|
|
But exception seems to pop up after main in - when GC is collecting - i'm thinking - and there's no way to trap that.
|
|
|
|
|
Try catching the exception raised by Application.Run() in a try catch block or handle the Application.ThreadException event.
Graham
|
|
|
|
|
I too periodically see an error dialog flash when I quit my application. It seems to have started after I overrode WndProc to perform some custom drawing in a List View control, and doesn't seem to occur with any consistency. My gut says the window handle is being disposed while some of the painting routines are using it, but in all honestly I don't know enough and shouldn't even speculate.
If you find a way to "capture" what the error dialog says, let me know.
Regards,
Chris
-- modified at 23:42 Monday 24th April, 2006
|
|
|
|
|
I think, that you've forgot to dispose some GDI+ objects. For example, Graphics
Best regards, Alexey.
|
|
|
|
|
I think, that you've forgot to dispose some COM objects. Try to set them null value.
To see this error, try to set Thread.Sleep(time); after Application.Run(...) with time in milliseconds.
Best regards, Alexey.
|
|
|
|
|
but shouldn't they be disposed when the applciation quits? what is the GC for then? In any case I think I do set them to null and even call ReleaseComObject - no help

|
|
|
|
|
i want to create a tipical bar that appear when i try to move a separetor for example.
It appear with the oppost color of the image above.
How?
|
|
|
|
|
|
tnx but i don't know how delete the line i've drawed...
|
|
|
|
|
As mentioned in the page to which I posted the link, you call the DrawReversibleFrame method a second time (passing in the same Rectangle as the first call) to erase the frame.
Josh
|
|
|
|
|
Hi and THANKS a lot in advance.
I'm getting this error in a different scenario, and I'm in a big urge to get this done, so please MS people and guys of the forum, any help is greatly appreciated.
I'll use a simplified scenario of my case, but the error happens the same. I'm creating a new User Control, I add a DataGridView to it, that's the only control in it. I then create a public property called "Columns" to expose the DataGridView Columns property so I can access the property to the Designer Editor. I do that this way:
namespace WindowsApplication3
{
public partial class myUC : UserControl
{
public myUC()
{
InitializeComponent();
}
[Editor("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public DataGridViewColumnCollection Columns
{
get { return this.dataGridView1.Columns; }
}
}
}
I took all that Attributes code from the System.Windows.Forms.DataGridView metadata, just as the Columns property appears in it.
Then, I add a Windows Forms item to my application and drag&drop one MyUC control from the toolbox into it. Then I click the MyUC and go to its properties page to modify the Columns properties just as with an ordinary DataGridView. The property is there but when clicking on its "..." button to open de Edit Columns Dialog I get the mentioned error. Something like this:
"Unable to cast object of type 'WindowsApplication3.myUC" to type "System.Windows.Forms.DataGridView".
I really really need the Columns property to be accesible in Design Time this way. I don't know how to work this out.
As I said, I get this error with an almost blank project. Just add a User Control Item, put a DataGridView into it. Ade the code above to make the Columns property visible and then try to access the property in the Property page.
Thank you so much in advance.
F.
PD: I'm using the shipped VS.NET 2005.
-- modified at 12:47 Monday 24th April, 2006
|
|
|
|
|
It seems that the DataGridViewColumnCollectionEditor is receiving an argument which it expects to be a DataGridView, but is instead receiving an instance of your UserControl. You have two options:
1) Expose the DataGridView as a property of your UserControl, instead of the Columns property. Through that property you can access the columns in the grid.
2) Derive from DataGridViewColumnCollectionEditor and make your sub-class work properly with your UserControl. You can use Lutz Roeder's Reflector tool to investigate how the DataGridViewColumnCollectionEditor works, and tweak your code so that it plays nice with the UserControl. Then modify the EditorAttribute on the Columns property so that it references your UITypeEditor, instead of the MS version.
Josh
|
|
|
|
|
Hey Josh, thanks for your quick response.
I had tried your suggestion 1 before, and I did it again with this simplified scenario. I get the "Object not set to an instance of an objet" error when clicking on the Columns Property of the exposed DataGridView property in my User Control.
Should I do something somewhere so it's initialized for Design access?
As for your suggestion 2, where do I find that Lutz Roeder's tool?
Thanks again.
|
|
|
|
|
I'm not sure what the problem is with the UITypeEditor. That sounds like something which requires detailed investigation to see what's wrong.
Reflector can be found here: http://www.aisto.com/roeder/dotnet/[^]
Josh
|
|
|
|