![](/img/trans.png)
[英]How we can secure the local.settings.json file inside our Azure Function before deploying it to Azure
[英]How can we compare the hash value of file in local path and same file uploaded on sharepoint site?
我正在使用 C#,Framework 4.6.1 (VS 2015)。 我正在使用 Microsoft.Graph api 將文件從本地路徑上傳到 Sharepoint 站點。 上傳文件后,我需要將本地路徑中文件的 hash 值與上傳到 sharepoint 站點的相同文件進行比較。 我用 System.Net.Webclient 嘗試了 MD5 算法,如下所示:
WebClient client = new WebClient();
using (var md5 = MD5.Create())
{
using (var stream = client.OpenRead(uri))
{
var hash = md5.ComputeHash(stream);
return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
}
}
在使用 Microsoft.Graph api(在 azure 活動目錄門戶上注冊應用程序)調用此方法之前,我已經完成了身份驗證,但即使在這之后我仍收到以下錯誤:“遠程服務器返回錯誤:(403)禁止訪問。”
任何人都可以幫助我如何找到和比較本地路徑中文件的 hash 值以及將同一文件上傳到 sharepoint 站點后的值?
注意:這是我正在實施的,只是為了驗證文件是否上傳成功。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.