Beispiel #1
0
        static void Main(string[] args)
        {
            NetworkCredential credential = new NetworkCredential("username", "password");
            WebdavSession     session    = new WebdavSession(credential);
            Resource          resource   = new Resource(session);

            resource.DownloadProgress += new DownloadProgressEventHandler(DownloadProgress);

            try
            {
                FileDownload fileDownload = resource.DownloadFile("http://myserver/dav/file1.txt", "c:\\temp\\file1.txt");

                //Press ENTER to abort download
                Console.Read();
                fileDownload.Abort();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.Read();
            }

            //Press ENTER to exit.
            Console.Read();
        }