some body gave me this link in above discussion
http://www.garykessler.net/library/file_sigs.html
it has solved my problem..
thanks bro.
int i = 0;
int count = 0;
OpenFileDialog op = new OpenFileDialog();
if (op.ShowDialog() == DialogResult.OK)
{
FileStream fstream = new FileStream(op.FileName, FileMode.Open);
while ((i = fstream.ReadByte()) != -1)
{
if (count == 10) break;
count++;
textBox1.Text += i.ToString() + " ";
}
if (textBox1.Text.Equals("80 75 3 4 20 0 6 0 8 0 "))
{
MessageBox.Show("docx file");
return;
}
MessageBox.Show("Not Docx");
}