我是網絡開發新手。我正在開發我的課程項目,使我在網站中訪問數據。我想從那裏爲用戶隱藏這些數據,以便他們在將來無法更改它。 我正在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. asp.net網址隱藏?
- 3. 隱藏window.location網址
- 4. 在網址中隱藏參數(Wordpress)
- 5. 隱藏網址,但保留子網址
- 6. 隱藏網址擴展
- 7. 如何隱藏網址
- 8. 從網址隱藏ID
- 9. 隱藏部分網址
- 10. mod_rewrite隱藏部分網址
- 11. 如何隱藏網址
- 12. 如何隱藏網址中的ID?
- 13. backbone.js。隱藏路由網址(在瀏覽器的網址欄中)?
- 14. 隱藏圖片包含數據庫信息的網址
- 15. 在PHP中隱藏音頻網址
- 16. 隱藏WordPress網站和圖片網址
- 17. 從網站隱藏index.php網址
- 18. Apache的mod_rewrite的 - 如何隱藏網址
- 19. 隱藏用戶的完整網址
- 20. jQuery的隱藏負載網址
- 21. 隱藏嵌入式視頻的網址
- 22. 更改回髮網址隱藏的Default.aspx
- 23. 隱藏數據網格的列(asp.net/c#)
- 24. 如何使用.htacess隱藏地址欄中的網址
- 25. 如何隱藏地址欄中顯示的網址(使用javascript)
- 26. 通過asp.net隱藏網址中的參數mvc routing
- 27. 我如何隱藏iframe中網站的網址?
- 28. 隱藏主要下載網址
- 29. 從網址隱藏所有控制器
- 30. 快速隱藏iOS/Android網址欄