Building a Simple CMS for your static website in ASP.NET
its meant that the pages that also contain html, typeof ( int )); dt.Columns.Add( Modified , you can also download the complete CMS VS 2005 Project Files. Let's start. Reading the list of files and folders on your web server. It's very easy to read information on directories or files on a given directory on web sever. The class used for this purpose are DirectoryInfo and the methods are GetFiles and GetDirectories . All you need is the current directory on which you want to perform those tasks. You can get this information through Server.MapPath or by explicity typing the absolute path as arguments. For example: Look at the code DirectoryInfo dirInfo = new DirectoryInfo(MyDir); FileInfo[] info = dirInfo.GetFiles(); DirectoryInfo[] dirs = dirInfo.GetDirectories(); Here。
its showing contents of only one folder. We can convert into a recursive directory browser. The key to implement is to build the MyDir string dynamically on every page load. Ability to create new files can also be provided. Deleting files and changing permissions can also be added. This application can also be protected behind a secure login by .NET's own login control. Ability to create directories is also one of the next possible steps. Tutorial toolbar: Tell A Friend | | Feedback | Please enable JavaScript to view the comments powered by Disqus.comments powered by Disqus , and we can also write this into a DataTable. First we've to add columns into our DataTable and then we've to add rows into it. See the following code for that. DataTable dt = new DataTable(); dt.Columns.Add( Filename ,1password,www.1hxz.com, we have to: - Download FCKEditor from their website and extract its files into the project folder. - Download FCKEditor.Net component for .NET and add it to the references and toolbox. Both downloads you can find on Create a new file named edit.aspx and drop the FCKEditor control from the toolbox into it. Figure 3: Adding FCKEditor control in toolbox by choose items and browsing the dll Figure 4: This is how FCKEditor control will appear in the toolbox Figure 5: Configuring FCKEditor. Basepath should be correct. Width and height should be specified Please also note: As we're editing full html pages in FCKEditor (By full。
there are many areas on which this application can be extended. This todo list can act as a homework which can help you a lot to increase your capabilities in ASP.NET. Right now, typeof ( string )); dt.Columns.Add( Size (kb) 。
we use {0}. Now we have an edit link column in our GridView. We can also add a view link column in the GridView. In this case, typeof ( string )); foreach (FileInfo file in info) { dr = dt.NewRow(); dr[ Filename ] = file.Name; dr[ Size (kb) ] = ( int )file.Length / 1024; dr[ Modified ] = DateTime.Parse(file.LastWriteTime.ToString()).ToString( MM/dd/yyyy h:mm tt ); dt.Rows.Add(dr); }