本文整理汇总了C#中Files类的典型用法代码示例。如果您正苦于以下问题:C# Files类的具体用法?C# Files怎么用?C# Files使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Files类属于命名空间,在下文中一共展示了Files类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Form1
public Form1()
{
InitializeComponent();
Files mainView = new Files() { Dock = DockStyle.Fill };
Controls.Add(mainView);
}
示例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;
}
示例3: Create
public ActionResult Create(FormCollection collection)
{
var model = new Files();
this.TryUpdateModel<Files>(model);
this.ProjectService.SaveFile(model);
return this.RefreshParent();
}
示例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();
}
示例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);
}
示例6: Execute
public void Execute(object parameter)
{
Contact c = (Contact)parameter;
Files FilesPage = new Files(c);
App.Current.MainWindow = FilesPage;
FilesPage.Show();
}
示例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);
}
}
示例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;
}
}
示例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;
}
示例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");
}
示例11: LocalLister
public LocalLister(Files files, BackupProgress backupProgress)
{
this.files = files;
this.backupProgress = backupProgress;
executor = new AbortableTaskExecutor(ListBackupLocations);
Settings.Default.PropertyChanged += SettingsChanged;
}
示例12: AddFileToDB
public static int AddFileToDB(Files fi)
{
using (var db = new IndexerModel())
{
db.Files.Add(fi);
return db.SaveChanges();
}
}
示例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);
}
示例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();
}
示例15: BackupEngine
public BackupEngine(Files files, BackupProgress backupProgress)
{
this.files = files;
this.backupProgress = backupProgress;
executor = new AbortableTaskExecutor(Backup);
retryHelper = new RetryHelper();
retryHelper.ExceptionOccured += ExceptionOccured;
}