<% Response.Write("<html>") Response.Write("<head>") Response.Write("</head>") Response.Write("<body>")
dim max,min,rand max=10 min=0 Randomize() rand=round((max-min+1)*Rnd+min)
Response.Write("<form action='createATextFile.asp' method='post'>") Response.Write("Player ID: ") Response.Write("<input type='text' name='id' size='20' />") Response.Write("<br />") Response.Write("Player First Name: ") Response.Write("<input type='text' name='fName' size='20' />") Response.Write("<br />") Response.Write("Player Last Name: ") Response.Write("<input type='text' name='lName' size='20' />") Response.Write("<br />") Response.Write("Player Age: ") Response.Write("<input type='text' name='age' size='20' />") Response.Write("<br />") Response.Write("Player nation: ") Response.Write("<input type='text' name='nation' size='20' />") Response.Write("<br />") Response.Write("Player Wage (Per Mounth): ") Response.Write("<input type='text' name='wagePM' size='20' />") Response.Write("<br />") Response.Write("<br />") Response.Write("Properties:") Response.Write("<br />") Response.Write("Player Athletic Ability: ") Response.Write("<input type='text' name='aAbility' size='20' />") Response.Write("<br />") Response.Write("Player Midfield Ability: ") Response.Write("<input type='text' name='mAbility' size='20' />") Response.Write("<br />") Response.Write("Player Play Making Ability : ") Response.Write("<input type='text' name='pMakingAbility' size='20' />") Response.Write("<br />") Response.Write("Player Goalkepper Ability: ") Response.Write("<input type='text' name='gKepper' size='20' />") Response.Write("<br />") Response.Write("Player Passing Ability : ") Response.Write("<input type='text' name='pAbility' size='20' />") Response.Write("<br />") Response.Write("Player Defender Ability: ") Response.Write("<input type='text' name='defender' size='20' />") Response.Write("<br />") Response.Write("Player Setpieces Ability: ") Response.Write("<input type='text' name='setPieces' size='20' />") Response.Write("<br />") Response.Write("<input type='submit' value='Submit' />") Response.Write("</form>") Response.Write("<br />") Response.Write("<br />") Response.Write("<br />")
dim id, fName, lName, age, nation, wagePM, aAbility, mAbility, pMakingAbility,gKepper, pAbility, defender, setPieces, quickness, strength, wisdom, goreAbility
Set id = Request.Form("id") Set fName = Request.Form("fName") Set lName = Request.Form("lName") Set age = Request.Form("age") Set nation = Request.Form("nation") Set wagePM = Request.Form("wagePM") Set aAbility = Request.Form("aAbility") Set mAbility = Request.Form("mAbility") Set pMakingAbility = Request.Form("pMakingAbility") Set gKepper = Request.Form("gKepper") Set pAbility = Request.Form("pAbility") Set defender = Request.Form("defender") Set setPieces = Request.Form("setPieces") Set quickness = rand Set strength = rand Set wisdom = rand Set goreAbility = rand
dim fs,fRead,fWrite
Set fs=Server.CreateObject("Scripting.FileSystemObject") Set fRead=fs.OpenTextFile(Server.MapPath("somefile.txt"), 1) set fWrite=fs.CreateTextFile("C:\\Inetpub\\wwwroot\\TextStream\\somefile1.txt",true)
do fWrite.WriteLine(fRead.ReadLine()) loop while fRead.AtEndOfStream=false
fWrite.WriteLine("Player ID: " & id) fWrite.WriteLine("Player Name: " & fName & " " & lName) fWrite.WriteLine("Player Age: " & age) fWrite.WriteLine("Player Nation: " & nation) fWrite.WriteLine("Player Wage (Per Mounth): " & wagePM) fWrite.WriteLine("Player Athletic Ability: " & aAbility) fWrite.WriteLine("Player Midfield Ability: " & mAbility) fWrite.WriteLine("Player Play Making Ability : " & pMakingAbility) fWrite.WriteLine("Player GoalKepper Ability: " & gKepper) fWrite.WriteLine("Player Passing Ability: " & pAbility) fWrite.WriteLine("Player Defender Ability: " & defender) fWrite.WriteLine("Player Setpieces Ability: " & setpieces) fWrite.WriteLine("Player Quickness: " & quickness) fWrite.WriteLine("Player Strength: " & strength) fWrite.WriteLine("Player Wisdom: " & wisdom) fWrite.WriteLine("Player Gore Ability: " & goreAbility)
fWrite.WriteLine("") fWrite.WriteLine("")
fRead.Close() fWrite.Close() Set fWrite=nothing Set fRead=nothing Set fs=nothing
Set fs=Server.CreateObject("Scripting.FileSystemObject") Set fRead=fs.OpenTextFile(Server.MapPath("somefile1.txt"), 1) set fWrite=fs.CreateTextFile("C:\\Inetpub\\wwwroot\\TextStream\\somefile.txt",true) do fWrite.WriteLine(fRead.ReadLine()) loop while fRead.AtEndOfStream=false
fRead.Close() fWrite.Close() Set fWrite=nothing Set fRead=nothing Set fs=nothing
Response.Write("</body>") Response.Write("</html>") %>
|