• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Files类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Files的典型用法代码示例。如果您正苦于以下问题:C# Files类的具体用法?C# Files怎么用?C# Files使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Files类属于命名空间,在下文中一共展示了Files类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Form1

        public Form1()
        {
            InitializeComponent();

            Files mainView = new Files() { Dock = DockStyle.Fill };
            Controls.Add(mainView);
        }
开发者ID:flagmanAndrew,项目名称:FileBrowser_MVVM,代码行数:7,代码来源:Form1.cs


示例2: ConvertToCotents

        public Files ConvertToCotents()
        {
            Files aFiles = new Files();

            aFiles.Code = this.Code;
            aFiles.Info = this.Info;
            aFiles.Intro = this.Intro;
            aFiles.Title = this.Title;

            aFiles.CodeAlbums = this.CodeAlbums;
            aFiles.CreateByIDUser = this.CreateByIDUser;
            aFiles.Disable = this.Disable;
            aFiles.DownloadCount = this.DownloadCount;
            aFiles.Height = this.Height;
            aFiles.Width = this.Width;
            aFiles.ID = this.ID;
            aFiles.IDLang = this.IDLang;

            aFiles.Image = this.Image;
            aFiles.Image1 = this.Image1;
            aFiles.Image2 = this.Image2;
            aFiles.Image3 = this.Image3;
            aFiles.Info = this.Info;
            aFiles.Status = this.Status;
            aFiles.Type = this.Type;
            aFiles.UploadDate = this.UploadDate;
            aFiles.ViewCount = this.ViewCount;

            return aFiles;
        }
开发者ID:califaxit,项目名称:manhquang,代码行数:30,代码来源:FilesExtEntity.cs


示例3: Create

 public ActionResult Create(FormCollection collection)
 {
     var model = new Files();
     this.TryUpdateModel<Files>(model);
     this.ProjectService.SaveFile(model);
     return this.RefreshParent();
 }
开发者ID:shenxingfu,项目名称:HaoTang,代码行数:7,代码来源:FilesController.cs


示例4: List

        public IQueryable<Files> List(string virtualPath)
        {
            string RepositoryDirectory = "c:\\ClientFiles";

            string basePath = RepositoryDirectory;

            if (!string.IsNullOrEmpty(virtualPath))
                basePath = Path.Combine(RepositoryDirectory, virtualPath);

            DirectoryInfo dirInfo = new DirectoryInfo(basePath);
            FileInfo[] files = dirInfo.GetFiles("*.*", SearchOption.AllDirectories);

            var vv = (from f in files
                      select new StorageFileInfo()
                      {
                          Size = f.Length,
                          VirtualPath = f.FullName.Substring(f.FullName.IndexOf(RepositoryDirectory) + RepositoryDirectory.Length + 1)
                      }).ToArray();

            var lff = new List<Files>();
            foreach (var info in vv)
            {
                var ff = new Files();
                ff.FileName = info.VirtualPath;
                ff.FileSize = info.Size;
                lff.Add(ff);
            }
            return lff.AsQueryable();
        }
开发者ID:foxjazz,项目名称:WCF-FileManager,代码行数:29,代码来源:FileSvc.svc.cs


示例5: SerwerSMS

		public SerwerSMS( String username, String password ){
		
			if( string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password) ){
				throw new Exception("Brak danych");
			}
			
			
			this.username 	= 	username;
			this.password 	= 	password;
			
			this.messages 	= 	new Messages(this);
			this.files 		= 	new Files(this);
			this.blacklist  = 	new Blacklist(this);
			this.error 		= 	new Errors(this);
			this.phones 	= 	new Phones(this);
			this.stats 		= 	new Stats(this);
			this.account 	= 	new Account(this);
			this.contacts 	= 	new Contacts(this);
			this.groups		= 	new Groups(this);
			this.payments	= 	new Payments(this);
			this.senders	= 	new Senders(this);
			this.premium	= 	new Premium(this);
			this.templates	= 	new Templates(this);
			this.subaccounts= 	new Subaccounts(this);
					
		}
开发者ID:xtechnology,项目名称:serwersms-csharp-api,代码行数:26,代码来源:SerwerSMS.cs


示例6: Execute

 public void Execute(object parameter)
 {
     Contact c = (Contact)parameter;
     Files FilesPage = new Files(c);
     App.Current.MainWindow = FilesPage;
     FilesPage.Show();
 }
开发者ID:sebaslh12,项目名称:AgentesMoviles,代码行数:7,代码来源:FilesPageCommand.cs


示例7: Extract

 public static void Extract(Files files)
 {
     if ((files & Files.InTheHandManaged) == Files.InTheHandManaged)
     {
         if (!File.Exists("InTheHand.Net.Personal.dll"))
             File.WriteAllBytes("InTheHand.Net.Personal.dll", Resources.InTheHand_Net_Personal);
     }
     if ((files & Files.InTheHandNative) == Files.InTheHandNative)
     {
         if (!File.Exists("32feetWidcomm.dll"))
         {
             if (CPU.Is64BitOperatingSystem())
                 File.WriteAllBytes("32feetWidcomm.dll", Resources._32feetWidcommx64);
             else
                 File.WriteAllBytes("32feetWidcomm.dll", Resources._32feetWidcommx86);
         }
     }
     if ((files & Files.VLC) == Files.VLC)
     {
         if (!File.Exists("libvlc.dll"))
             File.WriteAllBytes("libvlc.dll", Resources.libvlc);
         if (!File.Exists("libvlccore.dll"))
             File.WriteAllBytes("libvlccore.dll", Resources.libvlccore);
         if (!File.Exists("Vlc.DotNet.Core.dll"))
             File.WriteAllBytes("Vlc.DotNet.Core.dll", Resources.Vlc_DotNet_Core);
         if (!File.Exists("Vlc.DotNet.Forms.dll"))
             File.WriteAllBytes("Vlc.DotNet.Forms.dll", Resources.Vlc_DotNet_Forms);
     }
 }
开发者ID:byteit101,项目名称:ZomB-Dashboard-System,代码行数:29,代码来源:AutoExtractor.cs


示例8: Download

        public Download(string url, string file, FileDownloaded completionCallback, ProgressCallback progressCallback, Files f)
        {
            try
            {
                m_Url = url;
                m_CompletionCallback = completionCallback;
                try
                {
                    m_Stream = new FileStream( file, FileMode.OpenOrCreate, FileAccess.Write );
                }
                catch (IOException e)
                {
                    file = String.Concat( file, ".new" );
                    m_Stream = new FileStream( file, FileMode.OpenOrCreate, FileAccess.Write );
                }

                m_ProgressCallback = progressCallback;
                m_File = f;
                m_Thread = new Thread(new ThreadStart(DownloadFile));
                m_Thread.Start();
            }
            catch (Exception)
            {
                throw;
            }
        }
开发者ID:FreeReign,项目名称:UOMachine,代码行数:26,代码来源:Download.cs


示例9: SetValue

        public void SetValue(Files aFiles)
        {
            this.AlbumsName = "";
            this.Code = aFiles.Code;
            this.CodeAlbums = aFiles.CodeAlbums;
            this.CreateByIDUser = aFiles.CreateByIDUser;
            this.Disable = aFiles.Disable;
            this.DownloadCount = aFiles.DownloadCount;
            this.Height = aFiles.Height;
            this.Width = aFiles.Width;
            this.ID = aFiles.ID;
            this.IDLang = aFiles.IDLang;

            this.Image = aFiles.Image;
            this.Image1 = aFiles.Image1;
            this.Image2 = aFiles.Image2;
            this.Image3 = aFiles.Image3;
            this.Info = aFiles.Info;
            this.Status = aFiles.Status;
            this.Type = aFiles.Type;
            this.UploadDate = aFiles.UploadDate;
            this.ViewCount = aFiles.ViewCount;

            this.Info = aFiles.Info;
            this.Intro = aFiles.Intro;
            this.Title = aFiles.Title;
        }
开发者ID:califaxit,项目名称:manhquang,代码行数:27,代码来源:FilesExtEntity.cs


示例10: Create

        public ActionResult Create(AddStudentVM vm, HttpPostedFileBase upload)
        {
            var id = _work.EnrollDep.Find(x => x.Depid == vm.Depid && x.Campid == vm.Campid).Select(x => x.DepEnrolId);
            int enrollid = id.Single();

            var id2 = _work.EnrollBatch.Find(x => x.batch_id == vm.batch_id && x.DepEnrolId == enrollid).Select(x => x.BatchEnrolId);
            int BatchEnrollId = id2.Single();

            var SecEnrollId = _work.EnrollSection.Find(x => x.sec_id == vm.sec_id && x.BatchEnrolId == BatchEnrollId).Select(x => x.SecEnrolId).Single();

            Files f = new Files();
            Student st = new Student();

            st.Name = vm.Name;
            st.Email = vm.Email;
            st.Phone = vm.Phone;
            st.SecEnrolId = SecEnrollId;
            st.CreateDate = vm.CreateDate;
            st.semester = Semester.First.ToString();

            var errors = ModelState.Values.SelectMany(v => v.Errors);
            if (ModelState.IsValid)
            {
                if (upload != null && upload.ContentLength > 0)
                {

                    string path = Path.Combine(Server.MapPath("~/ProfilePhotos"),
                                      Path.GetFileName(upload.FileName));
                    upload.SaveAs(path);

                    ViewBag.Message = "File uploaded successfully";

                    f.FileName = Path.GetFileName(upload.FileName);
                }

                st.file = f;

                IEnumerable<CourseToDep> Allcourse = _work.CourseToDep.Find(x => x.semester == Semester.First && x.DepEnrolId == enrollid);

                List<StudentRegistration> obj = new List<StudentRegistration>();

                foreach (CourseToDep c in Allcourse)
                {
                    StudentRegistration reg = new StudentRegistration();
                    reg.Grades = Grades.initial;
                    reg.PersonId = f.PersonId;
                    reg.Semester = Semester.First;
                    reg.CId = c.CId;
                    reg.CreateDate = vm.CreateDate;
                    obj.Add(reg);
                }
                st.StudentReg = obj;

                _work.Student.Insert(st);
                _work.Save();

            }
            return RedirectToAction("Index");
        }
开发者ID:Rashid75,项目名称:Fyp,代码行数:59,代码来源:StudentsController.cs


示例11: LocalLister

        public LocalLister(Files files, BackupProgress backupProgress)
        {
            this.files = files;
            this.backupProgress = backupProgress;

            executor = new AbortableTaskExecutor(ListBackupLocations);
            Settings.Default.PropertyChanged += SettingsChanged;
        }
开发者ID:daspilker,项目名称:dasbackuptool,代码行数:8,代码来源:LocalLister.cs


示例12: AddFileToDB

 public static int AddFileToDB(Files fi)
 {
     using (var db = new IndexerModel())
     {
         db.Files.Add(fi);
         return db.SaveChanges();
     }
 }
开发者ID:asWorks,项目名称:FileIndexer,代码行数:8,代码来源:FilesRepository.cs


示例13: Index

        //
        // GET: /Cms/Files/

        public ActionResult Index(FileRequest request)
        {
          //  ViewData.Add("Channal", new SelectList(EnumHelper.GetItemValueList<EnumChannal>(), "Key", "Value"));
            var model = new Files();
            this.RenderMyViewData(model);
            var result = this.ProjectService.GetFileList(request);
            return View(result);
        }
开发者ID:715381959,项目名称:HaoTang,代码行数:11,代码来源:FilesController.cs


示例14: Setup

 public void Setup()
 {
     files = new Files();
     abcdFile = File(mocks, "abcd");
     files.Add(abcdFile);
     abdcFile = File(mocks, "abdc");
     files.Add(abdcFile);
     history = new HistoryTest.HistoryStub();
 }
开发者ID:srushti,项目名称:azazel,代码行数:9,代码来源:FilesTest.cs


示例15: BackupEngine

        public BackupEngine(Files files, BackupProgress backupProgress)
        {
            this.files = files;
            this.backupProgress = backupProgress;

            executor = new AbortableTaskExecutor(Backup);
            retryHelper = new RetryHelper();
            retryHelper.ExceptionOccured += ExceptionOccured;
        }
开发者ID:daspilker,项目名称:dasbackuptool,代码行数:9,代码来源:BackupEngine.cs


示例16: Create

 public ActionResult Create(FormCollection collection)
 {
     var model = new Files();
     model.SignDate = DateTime.Now.ToString("yyyy/MM/dd");
     model.FulfillDate = DateTime.Now.ToString("yyyy/MM/dd");
     model.EndDate = DateTime.Now.ToString("yyyy/MM/dd");
     model.Code = "NO."+model.CreateTime.ToFileTime();
     this.TryUpdateModel<Files>(model);
     this.ProjectService.SaveFile(model);
     return this.RefreshParent();
 }
开发者ID:715381959,项目名称:HaoTang,代码行数:11,代码来源:FilesController.cs


示例17: Main

 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Files F = new Files();
   /*  try
     {
         F.LoadSettings(Defines.SettingFilePath);
     }catch(Exception ex) { MessageBox.Show("读取配置文件失败。错误信息:\n" + ex.Message, "错误提示"); } */
     Application.Run(new MainForm());
 }
开发者ID:jingjiajie,项目名称:SmartEditor,代码行数:11,代码来源:Program.cs


示例18: toFiles

        private void toFiles(object sender, RoutedEventArgs e)
        {
            var item = (sender as FrameworkElement).DataContext;
            int index = ContactListView.Items.IndexOf(item);

            int contactIndex = Contacts.ElementAt(index).UserId;

            Console.WriteLine("Index of item clicked files: " + contactIndex);

            Files newFilesWpf = new Files(contactIndex);
            newFilesWpf.Show();
        }
开发者ID:Motta92,项目名称:Moviles,代码行数:12,代码来源:MainWindow.xaml.cs


示例19: AddFile

        public void AddFile(string content, ASSET_TYPES assetType)
        {
            using (var fileContext = new FileContext()) {
                var file = new Files {
                    AssetTypeID = (int)assetType,
                    Content = content
                };

                fileContext.FilesDS.Add(file);
                fileContext.SaveChanges();
            }
        }
开发者ID:jcapellman,项目名称:jcMPP,代码行数:12,代码来源:File.cs


示例20: Put

        public void Put(Files request)
        {
            var targetFile = GetAndValidateExistingPath(request);

            if (!this.Config.TextFileExtensions.Contains(targetFile.Extension))
                throw new NotSupportedException("PUT Can only update text files, not: " + targetFile.Extension);

            if (request.TextContents == null)
                throw new ArgumentNullException("TextContents");

            File.WriteAllText(targetFile.FullName, request.TextContents);
        }
开发者ID:rasikas,项目名称:ServiceStack.Examples,代码行数:12,代码来源:FilesService.cs



注:本文中的Files类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FillBehavior类代码示例发布时间:2022-05-24
下一篇:
C# FileUpload类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap