簡體   English   中英

當前上下文中不存在名稱“Randomize”

[英]The name “Randomize” doesnt exist in the current context

我在這里關注 Azure 文檔,它對代碼示例感到困惑,目前我看到這個錯誤與“隨機化”function,他們沒有記錄...

當前上下文中不存在名稱“Randomize”

我只是想在數據湖上上傳/下載(獲取文件位置)以用於一個用例。

string connectionString = Environment.GetEnvironmentVariable("AZURE_STORAGE_CONNECTION_STRING");
// Create DataLakeServiceClient
DataLakeServiceClient serviceClient = new DataLakeServiceClient(connectionString);

// Get a reference to a filesystem named "sample-filesystem-append" and then create it
DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient(Randomize("sample-filesystem-append"));
filesystem.Create();

另外,我使用連接字符串連接是否正確? 我認為它是一個合法參數,因為我沒有收到任何投訴,還是我必須使用StorageSharedKeyCredential代替?

RandomizeSampleTest class 中,在 GitHub 上可用 這個方法雖然很簡單:

public string Randomize(string prefix = "sample") => $"{prefix}-{Guid.NewGuid()}";

...所以它實際上只是用給定的前綴創建一個隨機字符串。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM