ali raza

C#, .Net , and my thoughts

Monthly Archives: February 2008

How to move on next page in document while using TX Text Control

Naviagation between pages is very  easy while using Tx Text control for documents like doc, txt,rtf and html in you dot net application. We have to use InputPosition of Tx Text Control its syntex is following

public InputPosition(int page, int line, int column);

here is sample code

Dim PageNo As IntegerPageNo = InputBox(“Page no.”, “Go to page”, “1”)If PageNo > 0 And PageNo <= TxtEditor.Pages Then

TxtEditor.ViewMode = TXTextControl.ViewMode.PageViewDim InputPosition As New TXTextControl.InputPosition(PageNo, 1, 0)TxtEditor.InputPosition = InputPosition //TxtEditor is name of txt textControlTxtEditor.ScrollLocation =

New System.Drawing.Point(0, TxtEditor.InputPosition.Location.Y)ElseMsgBox(“Page number outside valid range.”, MsgBoxStyle.Exclamation)End If

reference :

Keep Moving Ahead

He who is silent is forgotten;
He who does not advance, falls back;
He who stops is overwhelmed;
He who is out distanced is crushed;
He who ceases to grow, becomes smaller;
He who leaves off, gives up.

The moment you decide to stop in life,
its the begining of your end.
Keep moving ahead.

reference :

How to add dynamic meta tags in

Hi all you can add meta tags like that in page

HtmlMeta _MyName = new HtmlMeta();
_MyName.Name =” Ali Raza”;
_MyName.Content =” just in and test “;

How to get uploaded image dimensions in

I used following code to get uploaded image dimensions .
Where flLogoUplaoded is name of asp .net file uploaded control at my application
string UploadedImageType = flLogoUpload.PostedFile.ContentType.ToString().ToLower();
string UploadedImageFileName = flLogoUpload.PostedFile.FileName;

//Create an image object from the uploaded file
System.Drawing.Image UploadedImage = System.Drawing.Image.FromStream(flLogoUpload.PostedFile.InputStream);

//Determine width and height of uploaded image
float UploadedImageWidth = UploadedImage.PhysicalDimension.Width;
float UploadedImageHeight = UploadedImage.PhysicalDimension.Height;

Response.Write( UploadedImageWidth + “<br />”);
Response.Write(UploadedImageHeight + “<br />”);

Regular expression for html Table Parsing

here are some Regular expressions for html parsing . you can use it in your application while parsing html table to fetch data from it

  1.  Table Expression  = “<table[^>]*>(.*?)</table>”  
  2.   Header Expression  = “<th[^>]*>(.*?)</th>”  
  3.   Row Expression  = “<tr[^>]*>(.*?)</tr>”  
  4.   Column Expression  = “<td[^>]*>(.*?)</td>”