Name spaces to include: using System; using System.Text; using System.Threading; ---------------------------------------------- Progress bar class: class progressBar { /// <summary> /// An ASCII progress bar /// </summary> public class ProgressBar : IDisposable, IProgress<double> { private const int blockCount = 40; private readonly TimeSpan animationInterval = TimeSpan.FromSeconds(1.0 / 8); private const string animation = @"▀▀▀▀▄▄▄▄";//@"▀▀▀▀▄▄▄▄" @"|/-\"; ...
Source: http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application The following illustration shows what the page will look like when you're done. The column headings are links that the user can click to sort by that column. Clicking a column heading repeatedly toggles between ascending and descending sort order. Add Column Sort Links to the Students Index Page To add sorting to the Student Index page, you'll change the Index method of the Student controller and add code to the Student Index view. Add Sorting Functionality to the Index Method In Controllers\StudentController.cs , replace the Index method with the following code: public ActionResult Index ( string sortOrder ) { ViewBag . NameSortParm = String . IsNullOrEmpty ( sortOrder ) ? "Name_desc" : "" ; ViewBag . DateSortParm = sortOrder == "D...
Just call this method at the very end of your C# application to delete application’s executable file. /// <summary> /// This method deletes the exe that calls it. /// /// This method must be called right at the end of the application. /// </summary> private static void SelfDestroy() { var startInfo = new ProcessStartInfo(); startInfo.FileName = "cmd.exe" ; startInfo.RedirectStandardInput = true ; startInfo.UseShellExecute = false ; var process = new Process(); process.StartInfo = startInfo; process.Start(); // The delay is just making sure the exe to delete is done // running. var delayPings = 2; var exeName = AppDomain.CurrentDomain.Friend...
Comments
Post a Comment