the_one
چهارشنبه 15 خرداد 1387, 01:27 صبح
من یک تابع decoder و یک تابع encoder از یک سایتی گرفتم و لینکم را encode می کنه ولی وقتی
روش کلیک می کنم چون صفحه ای به شکل encode شده نداریم error میده:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /V2ViRm9ybTEuYXNweA==
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
این هم source تابعهای Encode و Decode :
Private Function EncodeBase64(ByVal input As String) As String
Dim strBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(input)
Return System.Convert.ToBase64String(strBytes)
End Function
Private Function DecodeBase64(ByVal input As String) As String
Dim strBytes() As Byte = System.Convert.FromBase64String(input)
Return System.Text.Encoding.UTF8.GetString(strBytes)
End Function
و وقتی هم که لینک رو بصورت decode بذارم که انگار اصلا" Encode نکردم!!
اگر میشه روش کد کردن آدرس صفحات رو توضیح بدین.
ممنون
:خجالت:
روش کلیک می کنم چون صفحه ای به شکل encode شده نداریم error میده:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /V2ViRm9ybTEuYXNweA==
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
این هم source تابعهای Encode و Decode :
Private Function EncodeBase64(ByVal input As String) As String
Dim strBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(input)
Return System.Convert.ToBase64String(strBytes)
End Function
Private Function DecodeBase64(ByVal input As String) As String
Dim strBytes() As Byte = System.Convert.FromBase64String(input)
Return System.Text.Encoding.UTF8.GetString(strBytes)
End Function
و وقتی هم که لینک رو بصورت decode بذارم که انگار اصلا" Encode نکردم!!
اگر میشه روش کد کردن آدرس صفحات رو توضیح بدین.
ممنون
:خجالت: