Thông tin tài liệu:
Part 5 Đọc và ghi vào Cookies trong ASP.NetCookie là một khái niệm khá quen thuộc trong trong lập trình Web, tuynhiên khi .NET ra đời rất nhiều người không hiểu cách sử dụnh chúngcó gì thay đổi và các thức làm việc có còn như xưa? Có rất nhiều cáchđịnh danh trong ASP.NET như web.config và global.asax, nhưng cònvề cookie
Nội dung trích xuất từ tài liệu:
Mẹo Lập Trình p 5 Part 5tempstr = tempstr & Three Case 4tempstr = tempstr & Four Case 5tempstr = tempstr & Five Case 6tempstr = tempstr & Six Case 7tempstr = tempstr & Seven Case 8tempstr = tempstr & Eight Case 9tempstr = tempstr & Nine Case 10tempstr = tempstr & Ten Case 11tempstr = tempstr & Eleven Case 12tempstr = tempstr & Twelve Case 13tempstr = tempstr & Thirteen Case 14tempstr = tempstr & Fourteen Case 15tempstr = tempstr & Fifteen Case 16tempstr = tempstr & Sixteen Case 17tempstr = tempstr & Seventeen Case 18tempstr = tempstr & Eighteen Case 19tempstr = tempstr & Nineteen End Selectnumstr = ((numstr / 10) - Int(numstr / 10)) * 10End Ifreturn tempstrEnd FunctionPublic Function AmericanNumerals(numstr As double) As StringDim tempstr as stringDim newstr as stringnumstr = Cdbl(numstr)If numstr > 10 ^ 24 Thenreturn Too bigExit FunctionEnd IfIf numstr >= 10 ^ 9 Thennewstr = AmericanNumerals(Int(numstr / (10^9)))numstr = ((numstr / 10 ^ 9) - Int(numstr / 10 ^ 9)) * 10 ^ 9If numstr = 0 Thentempstr = tempstr & newstr & Billion Else 31Copyright © http://vndownloads.nettempstr = tempstr & newstr & Bullion, End IfEnd IfIf numstr >= 10 ^ 6 Thennewstr = AmericanNumerals(Int(numstr / 10 ^ 6))numstr = ((numstr / 10 ^ 6) - Int(numstr / 10 ^ 6)) * 10 ^ 6If numstr = 0 Thentempstr = tempstr & newstr & Million Elsetempstr = tempstr & newstr & Million, End IfEnd IfIf numstr >= 10 ^ 3 Thennewstr = AmericanNumerals(Int(numstr / 10 ^ 3))numstr = ((numstr / 10 ^ 3) - Int(numstr / 10 ^ 3)) * 10 ^ 3If numstr = 0 Thentempstr = tempstr & newstr & Thousand Elsetempstr = tempstr & newstr & Thousand, End IfEnd IfIf numstr >= 10 ^ 2 Thennewstr = AmericanNumerals(Int(numstr / 10 ^ 2))numstr = ((numstr / 10 ^ 2) - Int(numstr / 10 ^ 2)) * 10 ^ 2If numstr = 0 Thentempstr = tempstr & newstr & Hundred Elsetempstr = tempstr & newstr & Hundred And End IfEnd IfIf numstr >= 20 ThenSelect Case Int(numstr / 10)Case 2tempstr = tempstr & Twenty Case 3tempstr = tempstr & Thirty Case 4tempstr = tempstr & Forty Case 5tempstr = tempstr & Fifty Case 6tempstr = tempstr & Sixty Case 7tempstr = tempstr & Seventy Case 8tempstr = tempstr & Eighty Case 9tempstr = tempstr & Ninety End Selectnumstr = ((numstr / 10) - Int(numstr / 10)) * 10End If 32Copyright © http://vndownloads.netnumstr=Int(numstr+0.5)If numstr > 0 ThenSelect Case NUMSTR MOD 100Case 1tempstr = tempstr & One Case 2tempstr = tempstr & Two Case 3tempstr = tempstr & Three Case 4tempstr = tempstr & Four Case 5tempstr = tempstr & Five Case 6tempstr = tempstr & Six Case 7tempstr = tempstr & Seven Case 8tempstr = tempstr & Eight Case 9tempstr = tempstr & Nine Case 10tempstr = tempstr & Ten Case 11tempstr = tempstr & Eleven Case 12tempstr = tempstr & Twelve Case 13tempstr = tempstr & Thirteen Case 14tempstr = tempstr & Fourteen Case 15tempstr = tempstr & Fifteen Case 16tempstr = tempstr & Sixteen Case 17tempstr = tempstr & Seventeen Case 18tempstr = tempstr & Eighteen Case 19tempstr = tempstr & Nineteen End Selectnumstr = ((numstr / 10) - Int(numstr / 10)) * 10End Ifreturn tempstrEnd FunctionEnd ClassNumberToWord.vb This class was generated by a tool. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. 33Copyright © http://vndownloads.net ------------------------------------------------------------------------------Imports System.Xml.SerializationImports System.Web.Services.ProtocolsImports System.Web.ServicesPublic Class NumberToWordInherits System.Web.Services.Protocols.SoapClientProtocolPublic Sub New()MyBase.NewMe.Url = numerals.asmxEnd SubPublic Function Int(ByValnum As Double) As DoubleDim results() As Object = Me.Invoke(Int, New Object() {num})Return CType(results(0),Double)End FunctionPublic Function BeginInt(ByVal num As Double, ByVal callback As System.AsyncCallback, ByValasyncState As Object) As System.IAsyncResultReturn Me.BeginInvoke(Int, New Object() {num}, callback, asyncState)End FunctionPublic Function EndInt(ByVal asyncResult As System.IAsyncResult) As DoubleDim results() As Object = Me.EndInvoke(asyncResult)Return CType(results(0),Double)End FunctionPublic FunctionBritishNumerals(ByVal numstr As Double) As StringDim results() As Object = Me.Invoke(BritishNumerals, New Object() {numstr})Return CType(re ...