public void Sample01a_HelloWorld_Traverse() { // Create a temporary Lorem Ipsum file on disk that we can upload string originalPath = CreateTempFile(SampleFileContent); // Get a reference to a share named "sample-share" and then create it string shareName = Randomize("sample-share"); ShareClient share = new ShareClient(ConnectionString, shareName); share.Create(); try { // Create a bunch of directories ShareDirectoryClient first = share.CreateDirectory("first"); first.CreateSubdirectory("a"); first.CreateSubdirectory("b"); ShareDirectoryClient second = share.CreateDirectory("second"); second.CreateSubdirectory("c"); second.CreateSubdirectory("d"); share.CreateDirectory("third"); ShareDirectoryClient fourth = share.CreateDirectory("fourth"); ShareDirectoryClient deepest = fourth.CreateSubdirectory("e"); // Upload a file named "file" ShareFileClient file = deepest.GetFileClient("file"); using (FileStream stream = File.OpenRead(originalPath)) { file.Create(stream.Length); file.UploadRange( ShareFileRangeWriteType.Update, new HttpRange(0, stream.Length), stream); } Sample01a_HelloWorld.Traverse(ConnectionString, shareName); } finally { share.Delete(); } }