Guest User

Untitled

a guest
Jun 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <asp:Button ID="btnAddFolder" runat="server" Height="24px" Text="Add Folder"
  2. Width="148px" onclick="btnAddFolder_Click" />
  3. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  4. <br />
  5. <asp:Button ID="btnRemoveFolder" runat="server" Text="Remove Folder" />
  6. <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
  7. <br />
  8. <br />
  9. <asp:TreeView ID="TreeView1" runat="server" ImageSet="XPFileExplorer"
  10. NodeIndent="15">
  11. <ParentNodeStyle Font-Bold="False" />
  12. <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
  13. <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False"
  14. HorizontalPadding="0px" VerticalPadding="0px" />
  15. <NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black"
  16. HorizontalPadding="2px" NodeSpacing="0px" VerticalPadding="2px" />
  17. </asp:TreeView>
  18.  
  19. string pathToCreate = "~/UserFolders/" + TextBox1.Text;
  20. if(Directory.Exists(Server.MapPath(pathToCreate))
  21. {
  22. //In here, start looping and modify the path to create to add a number
  23. //until you get the value needed
  24. }
  25.  
  26. //Now you know it is ok, create it
  27. Directory.CreateDirectory(Server.MapPath(pathToCreate));
  28.  
  29. int SHCreateDirectory(HWND hwnd, LPCWSTR pszPath);
Add Comment
Please, Sign In to add comment