imports system.math function urlencoding(byval vstrin as string) dim strreturn as string strreturn = "" dim i as integer dim thischr as string dim innercode, hight8, low8 as integer for i = 1 to vstrin.length thischr = mid(vstrin, i, 1) if abs(asc(thischr)) < &hff then strreturn = strreturn & thischr else innercode = asc(thischr) if innercode < 0 then innercode = innercode + &h10000 end if hight8 = (innercode and &hff00) / &hff low8 = innercode and &hff strreturn = strreturn & "%" & hex(hight8) & "%" & hex(low8) end if next urlencoding = strreturn end function
以上就是asp.net中中文乱码问题的详细内容。
