Wednesday, October 28, 2009

Have you seen date beyond 31 in a Professional site?????????

hi,

while searching a flight for my home town i found an interesting thing in a site, there were option to select the date which can never come like 32 october 2009,33 october 2009,34 october 2009 up to 36 October 2009.

how can a professional developer do a mistake like this..?????????????

please have a look... 32 October 2009

in the above link please check the Drop down for the Flight Status:option...



waiting for your comments







Thanks
Anil Kumar Pandey
System Architect, MVP
Mumbai, Maharshtra



Intresting new features of Windows 7

hi all,
have a look to the interesting new features of the windows 7, the latest operating system from windows. please follow the below line...



Thanks
Anil Kumar Pandey
System Architect, MVP
Mumbai, Maharshtra

Thursday, October 8, 2009

Downloading a file

Hello all,

here is the code for downloading any file from the specified location using the file stream.. Please refer the code for the same..

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim root As String = "C:\Inetpub\wwwroot\Test\"
Dim filepath As String = "C:\Inetpub\wwwroot\Test\Test.2.zip"
If File.Exists(filepath) And filepath.StartsWith(root) Then
Dim filename As String = Path.GetFileName(filepath)
Response.
Clear()
Response.
ContentType = "application/octet-stream"
Response.
AddHeader("Content-Disposition", "attachment; filename=""" & filename & """")
Response.
Flush()
Response.
WriteFile(filepath)

End If
End Sub

Thanks
Anil Kumar Pandey
System Architect, MVP
Mumbai, Maharshtra

Friday, October 2, 2009

On Top of the World Today!!!!!!

Hello everyone,
I am very happy to inform you all that i have got the Prestigious Microsoft MVP(Most Valuable Professional) award today.. I dont have words to explain my feeling right now, this is all my friends good wishes that i have got this award. i would thanks to all my friends who have supported me in each moment of my life...

you can see the announce lise here.. MVP


Thanks
Anil Kumar Pandey
System Architect
Mumbai, Maharshtra

Friday, September 18, 2009

Reading a word file Using c#

Reading a word file in c# is very simple we just need to add the reference of the COM component in our application. Click on Add >> Reference and Select the COM tab, under that tab please select the Microsoft object library 9.0 or higher. and after this use the following code to read any file...


Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
object file = "D:\\Anil\\test\\testfile.doc"; // path for word file
object nullobj = System.Reflection.Missing.Value;
Microsoft.
Office.Interop.Word.Document doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,ref nullobj, ref nullobj, ref nullobj, ref nullobj);
doc.
ActiveWindow.Selection.WholeStory();
doc.
ActiveWindow.Selection.Copy();
IDataObject data
= Clipboard.GetDataObject();
string allText = data.GetData(DataFormats.Text).ToString();
doc.
Close(ref nullobj, ref nullobj, ref nullobj);
wordApp.
Quit(ref nullobj, ref nullobj, ref nullobj);
Textbox1.
Text = allText);


Happy Coading!!!

Thanks
Anil Kumar Pandey
System Architect
Mumbai, Maharshtra

Thursday, September 17, 2009

Getting no of characters remaing for a text box..

Many times we set the maximum length of the text box so that a user can only enter that no of specified characters. if you want to so that how many no of character is remaing for that text box , then we can display this using this code..
Here with the use of Javascript we can achieve this task. please check this below code.

Code for ASP page

<head>
<script LANGUAGE="JavaScript">
function textCounter(field,cntfield,maxlimit)
{
if (field.value.length > maxlimit)
{
field.
value = field.value.substring(0, maxlimit);
}
else
{
cntfield.
value = maxlimit -
field.
value.length;
}
}
>
>

<body>
<asp:TextBox ID="txtFeatures" runat="server" TextMode="MultiLine"
Columns
="28" Rows="5" Wrap="true" />
<br />
<input readonly type="text" name="remLen1" id="remLen1" size="3"
maxlength
="3" value="90" />
>


and this code we need to attach with the text box in the cs file.

public void Page_Load()
{
if (!(Page.IsPostBack)) {
txtFeatures.
Attributes("name") = "txtFeatures";
txtFeatures.
Attributes("onKeyUp") = "textCounter(txtFeatures,remLen1,90);";
txtFeatures.
Attributes("onKeyDown") = "textCounter(txtFeatures,remLen1,90);";
txtFeatures.
Attributes("onKeyPress") = "textCounter(txtFeatures,remLen1,90);";
}
}



This is the complete code for the same.. try it..

Happy Coding!!!

Thanks
Anil Kumar Pandey
System Architect
Mumbai, Maharshtra

Monday, September 14, 2009

AN INTERESTING INTERVIEW

AN INTERESTING INTERVIEW........Banta Strikes Again!!!

AN INTERESTING INTERVIEW

Interviewer
:Let me check your word Power...
Banta :Ok Sir ....
Interviewer : Tell me the opposite of .....good.
Banta :hmmmm..... Bad
Interviewer
: Come
Banta
: Go.
Interviewer : Ugly.
Banta : Pichlli.
Interviewer : PICHLLIIIII?
Banta
: UGLYYYYYYYYY..
Interviewer : Shut Up.
Banta : Keep Talking.
Interviewer k now stop these all..
Bantak now carry on this all
Interviewer
:abe...chup ho ja..chup ho ja..chup ho jaaaa
Banta
:abe bolta rah..bolta rah..bolta rahhh
Interviewer
:Areeee yaaar
Banta
: areeee dushmannnnnn
Interviewer
: Get Out.
Banta : Come In.
Interviewer : Oh my God.
Banta : Oh my Devil.
Interviewer : U r Rejected.
Banta: I m selected...I M SELECTED???REALLY??BALLE BALLE




Thanks
Anil Kumar Pandey
System Architect
Mumbai, Maharshtra