C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » JavaScript »

Java Script Log File


Posted Date: 07 Jul 2008      Posted By: Srinivas       Member Level: Gold     Points: 1   Responses: 2



How to write a log file using javascript




Responses

Author: kunal badgujar    08 Jul 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 4

hi..
try following code..


<html>
<head>
<script language="javascript">
function WriteToFile()
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("C:\\Test.txt", true);
s.WriteLine('Hello');
s.Close();
}
</script>
</head>
<body onLoad="WriteToFile()">

</body>
</html>



Author: Nithya    08 Jul 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 5

hi...
log file means its a text file...
So, If you want to create the text file on the client then I think you'll have to use an ActiveX object e.g.

<html>
<head>
<script language="javascript">
function WriteToFile()
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("C:\\Test1.txt", true);
s.WriteLine('Hello');
s.Close();
}
</script>
</head>
<body onLoad="WriteToFile()">

</body>
</html>



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Urgent HelpHow to add item in dropdown list When i click the add Button
Previous : javascript code
Return to Discussion Forum
Post New Message
Category: JavaScript

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use