get information form page and make them stored in a local txt file
来源:互联网 发布:企业在淘宝开店 编辑:程序博客网 时间:2024/06/11 03:01
<html><body><label>请输入你的编号:</label><input type="text" id="userNumber" onchange="numberFun()"/><br><label>请输入你的年龄:</label><input type="text" id="userAge" onchange="ageFun()"/><br><label>请输入你的性别:</label><label><input type="radio" name="radioSex" onclick="myFun()" value="男" >男</label><label><input type="radio" name="radioSex" onclick="myFun()" value="女" >女</label><br><button onclick="startTest()">开始测试</button><script>var sexValue;var ageValue;var numberValue;function CreateFile() { var fso, tf,ef; fso = new ActiveXObject("Scripting.FileSystemObject");//获取对象 var a="c:\\myTest.txt"; if(fso.FileExists(a)) { ef = fso.OpenTextFile(a,8); ef.WriteBlankLines(1) ; ef.WriteLine(numberValue+"号用户"+" 年龄:"+ageValue+" "+"性别:"+sexValue) ; ef.Close(); } else { tf = fso.CreateTextFile(a, true);//创建一个文件夹 // 写一行,并且带有新行字符。 //tf.WriteLine("图片标识 A B C D E F G H I J ") ; // 向文件写三个新行字符。 tf.WriteBlankLines(3) ; tf.WriteLine(numberValue+"号用户"+" 年龄:"+ageValue+" "+"性别:"+sexValue) ; tf.Close();//关闭 } }function startTest(){ //将用户信息写入文件 CreateFile(); //self.location="./page/start.html";}function numberFun(){ numberValue=document.getElementById("userNumber").value;}function ageFun(){ ageValue=document.getElementById("userAge").value;}function myFun(){ var obj=document.getElementsByName("radioSex"); for(var i=0;i<obj.length;i++) { if(obj[i].checked) { sexValue=obj[i].value; } } } </script></body></html>
Caution :Only IE supports.
0 0
- get information form page and make them stored in a local txt file
- How to Output a List of Files to a File and Sort Them in Linux
- LAST_QUERY in Form and OAF Page
- Use Flex and JavaScript to get the full path of a local File
- (对Web.config文件加密)encrypting sensitive information stored in the web.config file
- Incorrect information in file
- Get Local IP Address and Set in the IP Control
- 如何调用Makefile , enter to directory A and B,then make them
- Graph Visualization and Navigation in Information Visualization: A Survey 译文
- Oracle PROCEDURE make txt file
- Get Dataset from Stored Procedure in Oracle
- solution of overlap and non input data in .txt file
- php ajax debug method -- make log in a text file
- How to make a KML/KMZ file in Google Earth?
- Script compiler android and make a file system
- Calling a Stored Procedure in a Database
- Calling a Stored Procedure in a Database
- write data into a txt file in C#
- 九九八十一难之MySQL安装
- 介绍android 布局查看利器hierarchyviewer.bat
- JNI获取并修改Java中类的变量和静态变量的值
- 51nod——1270 数组的最大代价 动态规划解法
- linux中CPU各个模块的时钟驱动函数分析
- get information form page and make them stored in a local txt file
- lightoj-1305 - Area of a Parallelogram(几何)
- jsp内置对象实现登录
- jq的append可同时加多个元素。逗号隔开即可
- 334. Increasing Triplet Subsequence
- 二叉树的存储结构
- 【NOIP普及组模拟】DNA排序
- latex公式中的空格表示
- Valgrind内存泄漏和内存越界访问检查工具