Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:Button ID="btnAddFolder" runat="server" Height="24px" Text="Add Folder"
- Width="148px" onclick="btnAddFolder_Click" />
- <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
- <br />
- <asp:Button ID="btnRemoveFolder" runat="server" Text="Remove Folder" />
- <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
- <br />
- <br />
- <asp:TreeView ID="TreeView1" runat="server" ImageSet="XPFileExplorer"
- NodeIndent="15">
- <ParentNodeStyle Font-Bold="False" />
- <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
- <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False"
- HorizontalPadding="0px" VerticalPadding="0px" />
- <NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black"
- HorizontalPadding="2px" NodeSpacing="0px" VerticalPadding="2px" />
- </asp:TreeView>
- string pathToCreate = "~/UserFolders/" + TextBox1.Text;
- if(Directory.Exists(Server.MapPath(pathToCreate))
- {
- //In here, start looping and modify the path to create to add a number
- //until you get the value needed
- }
- //Now you know it is ok, create it
- Directory.CreateDirectory(Server.MapPath(pathToCreate));
- int SHCreateDirectory(HWND hwnd, LPCWSTR pszPath);
Add Comment
Please, Sign In to add comment