Create Folder in Document Library programmatically using the Object Model
![SharePoint 2016 Logo](https://markimarta.com/wp-content/uploads/2016/08/SharePoint-Logo_w492_h3121-150x150.jpg)
Here is the snippet of how to Create Folder in Document Library programmatically using the Object Model. It can be used in console applications for loading documents or timer-jobs.
string spsiteUrl = "http://spdev/"; string spwebUrl = "forum/"; string folder = "folder"; using (SPSite spsite = new SPSite(spsiteUrl)) { using (SPWeb spweb = spsite.OpenWeb(spwebUrl)) { SPFolder doclibFolder = spweb.Folders["DocLib"]; // Doclib is the URL name of document library SPFolder childFolder = doclibFolder.SubFolders.Add(folder); } }