using RamDavisk.Ramfs; using System; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using WebDAVSharp.Server; using WebDAVSharp.Server.Stores; using WebDAVSharp.Server.Stores.Locks; namespace RamDavisk { internal static class Program { /// /// 应用程序的主入口点。 /// [STAThread] private static void Main() { IWebDavStore store = new WebDavRamfsStore(new WebDavStoreItemLock()); var svr = new WebDavServer(ref store); const string url = "http://*:2333/"; svr.Start(url); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var mainForm = new Form { Text = $"RamDavisk run at {url}", Width = 360, Height = 120, }; var linkLabel = new LinkLabel { Dock = DockStyle.Fill, TextAlign = ContentAlignment.MiddleCenter, Text = url }; linkLabel.Click += delegate { Process.Start("explorer", @"\\localhost@2333\DavWWWRoot"); }; mainForm.Controls.Add(linkLabel); Application.Run(mainForm); svr.Stop(); } } }