我是網絡開發新手。我正在開發我的課程項目,使我在網站中訪問數據。我想從那裏爲用戶隱藏這些數據,以便他們在將來無法更改它。 我正在ASP.net上工作。幫助將不勝感激。隱藏網址中的數據
Q
隱藏網址中的數據
0
A
回答
1
您不能隱藏數據的URL 行駛,就像我的網址是text.aspx?姓=羅賓&姓氏=胡德 您可以在網址 加密數據,那麼是應該顯示像Test.aspx的?姓= 121sdnasdkjn121928 &姓氏= sadklsdn12981029 類似的東西 ,然後你在哪裏得到的數據,你需要解密的數據,它將返回實際的數據
這裏是加密或解密
public static string Encrypt(string clearText)
{
try
{
string EncryptionKey = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz1234567890";
byte[] clearBytes = Encoding.Unicode.GetBytes(clearText);
using (Aes encryptor = Aes.Create())
{
Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
encryptor.Key = pdb.GetBytes(32);
encryptor.IV = pdb.GetBytes(16);
using (MemoryStream ms = new MemoryStream())
{
using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write))
{
cs.Write(clearBytes, 0, clearBytes.Length);
cs.Close();
}
clearText = Convert.ToBase64String(ms.ToArray());
}
}
return clearText;
}
catch
{
return null;
}
}
public static string Decrypt(string cipherText)
{
try
{
string EncryptionKey = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz1234567890";
byte[] cipherBytes = Convert.FromBase64String(cipherText.Replace(" ", "+"));
using (Aes encryptor = Aes.Create())
{
Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
encryptor.Key = pdb.GetBytes(32);
encryptor.IV = pdb.GetBytes(16);
using (MemoryStream ms = new MemoryStream())
{
using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write))
{
cs.Write(cipherBytes, 0, cipherBytes.Length);
cs.Close();
}
cipherText = Encoding.Unicode.GetString(ms.ToArray());
}
}
return cipherText;
}
catch
{
return null;
}
}
功能
OR
可以使用術語URL路由,以及以隱藏真實的URL,並顯示虛假的URL用戶 喜歡以代替localhost:1544/Test.aspx文件,它會顯示本地主機:1544 /測試或本地主機:1544/what_ever_you_want 它會隱藏.aspx擴展名以及
希望這會幫助
1
您無法隱藏在URL中傳輸的數據。發送未在url中顯示的數據的最簡單方法是使用POST請求而不是GET請求。
相關問題
- 1. 根據網址隱藏div
- 2. 隱藏window.location網址
- 3. asp.net網址隱藏?
- 4. 隱藏SpannableString網址
- 5. 在網址中隱藏參數(Wordpress)
- 6. 隱藏網址,但保留子網址
- 7. 如何隱藏網址?
- 8. 隱藏部分網址
- 9. 隱藏網址擴展
- 10. Codeigniter隱藏網址段
- 11. 隱藏下載網址
- 12. 如何隱藏網址
- 13. 如何隱藏網址
- 14. 如何隱藏網址
- 15. 隱藏頁面網址asp.net
- 16. mod_rewrite隱藏部分網址
- 17. AJAX網址更改,隱藏#?
- 18. 從網址隱藏ID
- 19. 如何隱藏網址中的ID?
- 20. 如何隱藏網址中的ID
- 21. 如何隱藏網站的網址
- 22. backbone.js。隱藏路由網址(在瀏覽器的網址欄中)?
- 23. 隱藏圖片包含數據庫信息的網址
- 24. 在網址中隱藏文件名
- 25. 在PHP中隱藏音頻網址
- 26. 在彈出窗口中隱藏網址
- 27. 從網站隱藏index.php網址
- 28. 隱藏WordPress網站和圖片網址
- 29. Apache的mod_rewrite的 - 如何隱藏網址
- 30. 隱藏的php擴展的網址