<html>
<head>
<script language="javascript">
function loadexe()
{
alert('invoke');
w = new ActiveXObject("WScript.Shell");
w.run('notepad.exe');
return true;
}
</script>
</head>
<body onload=loadexe()>
</body>
</html>
Open EXE Using Javascript
Tuesday, November 27, 2007 | 0 Comments
CONVERT IMAGE TO BYTE USING ASP.NET
Namespaces :-
System.Drawing;
Coding :-
byte[] bytArray;
Bitmap bImg = new Bitmap(Server.MapPath(path));
ImageConverter imgCon = new ImageConverter();
bytArray = (byte[])imgCon.ConvertTo(bImg , typeof(byte[]));
Saturday, November 03, 2007 | 0 Comments
Upload the File in ASP.NET
In this example we browse a file from our pc and upload that file to some other loaction in our pc.
Default.aspx
\\Place a file type textbox and a button
<input type=file id=File1 name=File1 runat="server">
<input type="submit" id="Submit1" value="Upload" runat="server" name="Submit1">
Defalut.aspx.cs
if( ( File1.PostedFile != null ) && ( File1.PostedFile.ContentLength > 0 ) )
{
string fn = System.IO.Path.GetFileName(File1.PostedFile.FileName);
string SaveLocation = Server.MapPath("Data") + "\\" + fn;\\Create Data Folder within the Location u Specified
\\File will be Uploaded to the Specified Location
try
{
File1.PostedFile.SaveAs(SaveLocation);
Response.Write("The file has been uploaded.");
}
catch ( Exception ex )
{
Response.Write("Error: " + ex.Message);
}
}
else
{
Response.Write("Please select a file to upload.");
}
Sunday, October 07, 2007 | 0 Comments