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

C# IO.FileInfo类代码示例

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

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



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

示例1: runGame

 public void runGame()
 {
     //throw new Exception("LOGGING IS OFF!");
     base_dir = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName;
     AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
     AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
     var os = System.Environment.OSVersion;
     if (os.Version.Major > 5)
     {
         AppDomain.CurrentDomain.FirstChanceException += new EventHandler<System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs>(CurrentDomain_FirstChanceException);
     }
     try
     {
         var ass = System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes("GnomoriaModded.dll"));
         var ep = ass.EntryPoint;
         //var inst = ass.GetType("Game.GnomanEmpire").GetProperty("Instance").GetGetMethod().Invoke(null, new object[] { });
         //var obj = ass.CreateInstance(ep.Name);
         ep.Invoke(null, new object[] { new String[] { "-noassemblyresolve", "-noassemblyloading" } });
         return;
     }
     catch (Exception err)
     {
         CustomErrorHandler(err);
     }
 }
开发者ID:Rychard,项目名称:Faark.Gnomoria.Modding,代码行数:25,代码来源:GameLauncher.cs


示例2: cc_Click

        private void cc_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog d = new Microsoft.Win32.OpenFileDialog();
            d.Filter = "JPEG Image (*.JPG)|*.JPG";
               bool? result =  d.ShowDialog(this);
               if (result == true)
               {
               System.IO.FileInfo fi = new System.IO.FileInfo(d.FileName);
               //fi.CopyTo("..\\..\\Resources\\"+fi.Name,true);
               XmlDataProvider xdp = this.Resources["BookData"] as XmlDataProvider;
               System.Xml.XmlElement xe = (System.Xml.XmlElement)(e.Source as System.Windows.Controls.ContentControl).Content;
               if (xe["Image"] != null)
               {
                   xe["Image"].InnerText = fi.FullName;
                   //System.Xml.XmlTextWriter xr = new System.Xml.XmlTextWriter(new System.IO.FileStream(@"C:\a.txt", System.IO.FileMode.OpenOrCreate), Encoding.Unicode);
                   //xe.WriteTo(xr);
                   //xr.Close();

               }
               else
               {
                   System.Xml.XPath.XPathNavigator navigator = xe.CreateNavigator();
                   navigator.AppendChildElement(null, "Image", null, fi.FullName);
                   this.listBox.Items.Refresh();
               }
               }
        }
开发者ID:powernick,项目名称:CodeLib,代码行数:27,代码来源:MainWindow.xaml.cs


示例3: init

        public void init(Outlook.Attachment attach)
        {
            attachment = attach;
                System.IO.FileInfo fi = new System.IO.FileInfo(attachment.FileName);
                lNom.Text = "Nom : " + fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length);
                lType.Text = "Type : " + fi.Extension.ToString();
                lTaille.Text = "Taille : " + attachment.Size + " o";

                IDictionary<string, string> parameters = new Dictionary<string, string>();
                parameters[SessionParameter.BindingType] = BindingType.AtomPub;

                XmlNode rootNode = Config1.xmlRootNode();

                parameters[SessionParameter.AtomPubUrl] = rootNode.ChildNodes.Item(0).InnerText + "atom/cmis";
                parameters[SessionParameter.User] = rootNode.ChildNodes.Item(1).InnerText;
                parameters[SessionParameter.Password] = rootNode.ChildNodes.Item(2).InnerText;

                SessionFactory factory = SessionFactory.NewInstance();
                ISession session = factory.GetRepositories(parameters)[0].CreateSession();

                // construction de l'arborescence
                string id = null;
                IItemEnumerable<IQueryResult> qr = session.Query("SELECT * from cmis:folder where cmis:name = 'Default domain'", false);

                foreach (IQueryResult hit in qr) { id = hit["cmis:objectId"].FirstValue.ToString(); }
                IFolder doc = session.GetObject(id) as IFolder;

                TreeNode root = treeView.Nodes.Add(doc.Id, doc.Name);
                AddVirtualNode(root);
        }
开发者ID:ldoguin,项目名称:NuxeoOutlookAddin,代码行数:30,代码来源:NuxeoAttachList.cs


示例4: GetCurrentPageName

 internal static string GetCurrentPageName()
 {
     string sPath = System.Web.HttpContext.Current.Request.Url.AbsolutePath;
     System.IO.FileInfo oInfo = new System.IO.FileInfo(sPath);
     string sRet = oInfo.Name;
     return sRet;
 }
开发者ID:IndiansIncredible,项目名称:.NetIDS,代码行数:7,代码来源:Misc.cs


示例5: LoadPicture

        void LoadPicture()
        {
            this.OpenFile.Filter = "Images | *.jpg; *.png; *.jpeg";

            DialogResult result = this.OpenFile.ShowDialog();

            if ( result == DialogResult.OK )
            {
                string src = this.OpenFile.FileName;

                System.IO.FileInfo info = new System.IO.FileInfo( src );

                if ( ( info.Length / 1048576 ) < 1.5 )
                {
                    this.ptbPicture.Load( src );
                    this.lblSource.Text = src;
                    this._source = src;
                    this.btnCambiar.Enabled = true;
                    this.btnSalir.Enabled = true;
                }
                else
                {
                    MetroMessageBox.Show( this, "El Tamaño maximo para una imagen es de 1.5MB.", "LA imagen a superado el tamaño Maximo", MessageBoxButtons.OK, MessageBoxIcon.Warning );
                }
            }
        }
开发者ID:SIDET2015,项目名称:LawraDesktop,代码行数:26,代码来源:mdl_ChangePicture.cs


示例6: Read

        public List<string[]> Read()
        {
            try {
                System.IO.FileInfo backlogFile = new System.IO.FileInfo(SQ.Util.Constant.BACKLOG_FILE);
                if (!backlogFile.Exists){
                    backlogFile.Create();
                    return new List<string[]>();
                }

                System.IO.StreamReader sr = new System.IO.StreamReader (SQ.Util.Constant.BACKLOG_FILE);
                Repo.LastSyncTime = backlogFile.LastWriteTime;
                List<string[]> filesInBackLog = new List<string[]>();
                int i = 1;
                while (!sr.EndOfStream) {
                    string [] info = BreakLine (sr.ReadLine (), 5);
                    filesInBackLog.Add (info);
                    i++;
                }
                sr.Dispose();
                sr.Close ();
                return filesInBackLog;
            } catch (Exception e) {
                SQ.Util.Logger.LogInfo("Sync", e);
                return null;
            }
        }
开发者ID:adaptive,项目名称:qloudsync,代码行数:26,代码来源:BacklogSynchronizer.cs


示例7: Log4NetProvider

        public Log4NetProvider()
        {
            GlobalContext.Properties["appname"] = "TutorGroup.Api";

            try
            {
                var codeBaseUri = new Uri(Assembly.GetExecutingAssembly().CodeBase);
                var fileInfo = new System.IO.FileInfo(codeBaseUri.AbsolutePath);
                if (fileInfo.DirectoryName != null)
                {
                    var newConfigFilePath = System.IO.Path.Combine(fileInfo.DirectoryName, "ConfigurationFiles", "Logging/log4net/log4net.config");

                    if (System.IO.File.Exists(newConfigFilePath))
                    {
                        log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(newConfigFilePath));
                    }
                    else
                    {
                        throw new Exception("Log4net config file missing Error:");
                    }
                }
                else
                {
                    throw new Exception("Log4net config file missing Error:");
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Log4net Initialize Error:" + ex.Message, ex);
            }

            GetLogger(DEFAULT_LOGGER);
        }
开发者ID:pin0513,项目名称:hip.infras,代码行数:33,代码来源:Log4NetProvider.cs


示例8: Application_Start

        protected void Application_Start()
        {
            string configFileName = Server.MapPath("~/log.log4net");
            System.IO.FileInfo f = new System.IO.FileInfo(configFileName);
            LogHelper.LogHelper.SetConfig(f, "");
            LogHelper.LogHelper.Info("App Start");

            SqlHelper.SetConnString(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            System.Data.Entity.Database.SetInitializer<OUDAL.Context>(null);
            Application["Login"] = System.Configuration.ConfigurationManager.AppSettings["Login"];
            RootPath = System.Configuration.ConfigurationManager.AppSettings["path"];

            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            try
            {
                ClientBLL.AutoTransfer();
            }
            catch (Exception e)
            {

            }
            BundleMobileConfig.RegisterBundles(BundleTable.Bundles);

            //RealEstateCRM.Web.BLL.SynchronismWorkflow.SynchronishJob.Schedule();
        }
开发者ID:huaminglee,项目名称:RealEstateCRM,代码行数:30,代码来源:Global.asax.cs


示例9: BrowseButton_Click

 private void BrowseButton_Click(object sender, EventArgs e)
 {
     var path = "";
     GameApplicationOpenFileDialog.DefaultExt = ".exe";
     if (!string.IsNullOrEmpty(GameApplicationLocationTextBox.Text))
     {
         var fi = new System.IO.FileInfo(GameApplicationLocationTextBox.Text);
         if (string.IsNullOrEmpty(path)) path = fi.Directory.FullName;
         GameApplicationOpenFileDialog.FileName = fi.Name;
     }
     GameApplicationOpenFileDialog.Filter = Helper.GetFileDescription(".exe") + " (*.exe)|*.exe|All files (*.*)|*.*";
     GameApplicationOpenFileDialog.FilterIndex = 1;
     GameApplicationOpenFileDialog.RestoreDirectory = true;
     if (string.IsNullOrEmpty(path)) path = System.IO.Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));
     GameApplicationOpenFileDialog.InitialDirectory = path;
     GameApplicationOpenFileDialog.Title = "Browse for Executable";
     var result = GameApplicationOpenFileDialog.ShowDialog();
     if (result == System.Windows.Forms.DialogResult.OK)
     {
         // Don't allow to add windows folder.
         var winFolder = System.Environment.GetFolderPath(Environment.SpecialFolder.Windows);
         if (GameApplicationOpenFileDialog.FileName.StartsWith(winFolder))
         {
             MessageBoxForm.Show("Windows folders are not allowed.", "Windows Folder", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             GameApplicationLocationTextBox.Text = GameApplicationOpenFileDialog.FileName;
             ProcessExecutable(GameApplicationOpenFileDialog.FileName);
         }
     }
 }
开发者ID:jeppeter,项目名称:x360ce,代码行数:32,代码来源:GamesControl.cs


示例10: Application_Start

 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     System.IO.FileInfo configFile = new System.IO.FileInfo(System.AppDomain.CurrentDomain.BaseDirectory + "\\web.config");
     log4net.Config.XmlConfigurator.Configure(configFile);
     CharityPlatform.Data.AppHelper.Init();
 }
开发者ID:mikerossconsulting,项目名称:CharityPlatform,代码行数:7,代码来源:Global.asax.cs


示例11: itemSelectedBuild

        protected void itemSelectedBuild(object sender, EventArgs e)
        {
            try
            {
                System.String filename = "myFile.txt";

                // set the http content type to "APPLICATION/OCTET-STREAM
                Response.ContentType = "APPLICATION/OCTET-STREAM";

                // initialize the http content-disposition header to
                // indicate a file attachment with the default filename
                // "myFile.txt"
                System.String disHeader = "Attachment; Filename=\"" + filename +
                   "\"";
                Response.AppendHeader("Content-Disposition", disHeader);

                // transfer the file byte-by-byte to the response object
                System.IO.FileInfo fileToDownload = new
                   System.IO.FileInfo("C:\\downloadJSP\\DownloadConv\\myFile.txt");
                Response.Flush();
                Response.WriteFile(fileToDownload.FullName);
            }
            catch (System.Exception exc)
            // file IO errors
            {
            }
        }
开发者ID:GehteuchNixan,项目名称:HODOR,代码行数:27,代码来源:Produkte.aspx.cs


示例12: ShowAddPackageDialog

        public static void ShowAddPackageDialog(string selectedFileName, string projectGuid = null)
        {
            Paket.Dependencies dependenciesFile = null;

            try
            {
                dependenciesFile = Paket.Dependencies.Locate(selectedFileName);
            }
            catch (Exception)
            {
                var dir = new System.IO.FileInfo(SolutionExplorerExtensions.GetSolutionFileName()).Directory.FullName;
                Dependencies.Init(dir);
                dependenciesFile = Paket.Dependencies.Locate(selectedFileName);
            }

            var secondWindow = new AddPackage();

            //Create observable paket trace
            var paketTraceObs = Observable.Create<Logging.Trace>(observer =>
            {
                [email protected](x => observer.OnNext(x));
                return Disposable.Create(() =>
                {
                   
                });
               
            });

            Action<NugetResult> addPackageToDependencies = result =>
            {
                if (projectGuid != null)
                {
                    var guid = Guid.Parse(projectGuid);
                    SolutionExplorerExtensions.UnloadProject(guid);
                    dependenciesFile.AddToProject(Microsoft.FSharp.Core.FSharpOption<string>.None, result.PackageName, "", false, false, false, false, selectedFileName, true, SemVerUpdateMode.NoRestriction);
                    SolutionExplorerExtensions.ReloadProject(guid);
                }
                else
                    dependenciesFile.Add(Microsoft.FSharp.Core.FSharpOption<string>.None, result.PackageName, "", false, false, false, false, false, true, SemVerUpdateMode.NoRestriction);
            };

            Func<string, IObservable<string>> searchNuGet = 
                searchText => Observable.Create<string>(obs =>
                {
                    var disposable = new CancellationDisposable();

                    dependenciesFile
                        .SearchPackagesByName(
                            searchText,
                            FSharpOption<CancellationToken>.Some(disposable.Token),
                            FSharpOption<int>.None)
                        .Subscribe(obs);

                    return disposable;
                });
          
            //TODO: Use interfaces?
            secondWindow.ViewModel = new AddPackageViewModel(searchNuGet, addPackageToDependencies, paketTraceObs);
            secondWindow.ShowDialog();
        }
开发者ID:freeman,项目名称:Paket.VisualStudio,代码行数:60,代码来源:AddPackageProcess.cs


示例13: CreateDatabase

        internal static void CreateDatabase(string DbFile)
        {
            string path = new System.IO.FileInfo(DbFile).DirectoryName;
            if (!System.IO.Directory.Exists(path))
                System.IO.Directory.CreateDirectory(path);

            SQLiteConnection.CreateFile(DbFile);

            using(SQLiteConnection conn = new SQLiteConnection(@"Data Source={0};Version=3;".FormatStr(DbFile))){
                conn.Open();
                foreach (Match match in Regex.Matches(Resources.Files.CreateDatabase_sql, @"(.*?)(([\s]+GO[\s]*)|$)", RegexOptions.Singleline | RegexOptions.IgnoreCase))
                {
                    string sql = match.Value.Trim();
                    if (sql.ToUpper().EndsWith("GO"))
                        sql = sql.Substring(0, sql.Length - 2).Trim();
                    if (sql.Length == 0)
                        continue;
                    using (SQLiteCommand cmd = new SQLiteCommand(sql, conn))
                    {
                        cmd.ExecuteNonQuery();
                    }
                }
                using(SQLiteCommand cmd = new SQLiteCommand("INSERT INTO [version](databaseversion) VALUES ({0})".FormatStr(Globals.DB_VERSION), conn))
                {
                    cmd.ExecuteNonQuery();
                }
                conn.Close();
            }

            DbHelper.DbFile = DbFile;
        }
开发者ID:revenz,项目名称:NextPvrWebConsole,代码行数:31,代码来源:DbHelper.cs


示例14: Window_Loaded

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //read config
            string PathDB = Logs.getPath() + "\\DB\\quran.db";
            System.IO.FileInfo ConFile = new System.IO.FileInfo(PathDB);
            if (!ConFile.Exists)
            {
                MessageBox.Show("Database not found.");
                Application.Current.Shutdown();

            }
            string ConStr = string.Format("Data Source={0};Version=3;", ConFile.FullName);
            BLL.quran_data.Conn = ConStr;

            //string ConStr = ConfigurationManager.ConnectionStrings["quran_context"].ConnectionString;
            //UrlRecitation = ConfigurationManager.AppSettings["UrlRecitation"];

            //player events
            QuranPlayer.MediaFailed += media_MediaFailed;
            QuranPlayer.MediaEnded += QuranPlayer_MediaEnded;

            //button events
            StopBtn.Click += StopBtn_Click;
            PlayBtn.Click += PlayBtn_Click;
            NextBtn.Click += NextBtn_Click;
            PrevBtn.Click += PrevBtn_Click;
            BookmarkBtn.Click += BookmarkBtn_Click;
            //QFE.WPF.Tools.CacheManager<string> Cache = new Tools.CacheManager<string>();
            //Cache["hosni"] = "gendut";
            //MessageBox.Show(Cache["hosni"]);

            InitQuran();

            //Init speech recognizer
            manualResetEvent = new ManualResetEvent(false);

            ListenToBoss();

            /*
            //real sense start
            cam = Camera.Create(); //autodiscovers your sdk (perceptual or realsense)

            //cam.Face.Visible += Face_Visible;
            //cam.Face.NotVisible += Face_NotVisible;
            cam.Gestures.SwipeLeft += Gestures_SwipeLeft;
            cam.Gestures.SwipeRight += Gestures_SwipeRight;
            //cam.Gestures.SwipeUp += Gestures_SwipeUp;
            //cam.Gestures.SwipeDown += Gestures_SwipeDown;
            cam.RightHand.Moved += RightHand_Moved;
            cam.LeftHand.Moved += LeftHand_Moved;
            cam.Start();


            //timer for human detection
            dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, CurrentState.config.ShutdownTime, 0);
            dispatcherTimer.Start();
            */
        }
开发者ID:Gravicode,项目名称:QFE,代码行数:60,代码来源:MainWindow.xaml.cs


示例15: addLog

 public static void addLog(string s)
 {
     System.Diagnostics.Debug.WriteLine(s);
     if (bDoLogging)
     {
         try
         {
             if (System.IO.File.Exists(LogFilename))
             {
                 System.IO.FileInfo fi = new System.IO.FileInfo(LogFilename);
                 if (fi.Length > maxFileSize)
                 {
                     //create backup file
                     System.IO.File.Copy(LogFilename, LogFilename + "bak", true);
                     System.IO.File.Delete(LogFilename);
                 }
             }
             System.IO.StreamWriter sw = new System.IO.StreamWriter(LogFilename, true);
             sw.WriteLine(DateTime.Now.ToShortDateString()+ " " + DateTime.Now.ToShortTimeString() + "\t" + s);
             sw.Flush();
             sw.Close();
         }
         catch (Exception ex)
         {
             System.Diagnostics.Debug.WriteLine("Exception in addLog FileWrite: " + ex.Message);
         }
     }
 }
开发者ID:hjgode,项目名称:mail_grabber,代码行数:28,代码来源:helpers.cs


示例16: InitLangs

        private void InitLangs()
        {
            bEdit.IsEnabled = (lb.SelectedItem != null);
            lb.Items.Clear();

            var a = System.IO.Directory.GetFiles("Languages", "*.ulex");
            var LstA = new List<string>();
            foreach (var i in a) {
                var u = new System.IO.FileInfo(i).Name;
                u = u.Remove(u.LastIndexOf('.'));
                LstA.Add(u);
            }
            if (System.IO.Directory.GetFiles(Shared.LocalData("Languages")).Length > 0) {
                a = System.IO.Directory.GetFiles(Shared.LocalData("Languages\\"), "*.ulex");
                foreach (var i in a) {
                    var u = new System.IO.FileInfo(i).Name;
                    u = u.Remove(u.LastIndexOf('.'));
                    if (LstA.Contains(u)) LstA.Remove(u);
                    LstA.Add(u);
                }
            }
            foreach (var u in LstA) {
                lb.Items.Add(new Language(u));
            }

        }
开发者ID:RasyidUFA,项目名称:UFSJ,代码行数:26,代码来源:LangMgrWnd.xaml.cs


示例17: AddFile

        public bool AddFile(string localFilePath, int roomId)
        {
            var roomsApi = getRoomsApi();
            string fileId = null;
            int maxFileSize = 10000000; // bytes.. 10 MB
            System.IO.FileInfo fi = new System.IO.FileInfo(localFilePath);
            if (!fi.Exists)
            {
                _lastError = "File doesn't exist.";
            }
            else if (fi.Length > maxFileSize)
            {
                _lastError = "File size cannot be greater than " + maxFileSize + " bytes.";
            }
            else
            {
                string fileName = fi.Name;
                byte[] fileContent = new byte[fi.Length];
                System.IO.Stream str = fi.OpenRead();
                str.Read(fileContent, 0, Convert.ToInt32(fi.Length));
                string fileData = Convert.ToBase64String(fileContent);
                var result = roomsApi.PostFile(getAuthHeader(), roomId, 0, fileName, fileData);
                if (result.success && result.data != null) fileId = result.data.ToString();
                else _lastError = result.code.ToString();
                str.Close();
                str.Dispose();
            }

            return fileId != null;
        }
开发者ID:endermert,项目名称:perculus-sdk-dotnet,代码行数:30,代码来源:RoomService.cs


示例18: GetCurrentPageName

 public static string GetCurrentPageName(string URL)
 {
     //string sPath = System.Web.HttpContext.Current.Request.Url.AbsolutePath;
     System.IO.FileInfo oInfo = new System.IO.FileInfo(URL);
     string sRet = oInfo.Name;
     return sRet;
 }
开发者ID:califaxit,项目名称:manhquang,代码行数:7,代码来源:StringUtility.cs


示例19: getFiles

        private System.Collections.Generic.List<string> getFiles(string location, bool recursive)
        {
            System.Collections.Generic.List<string>  sc = new List<string>();

            System.IO.FileInfo fi = new System.IO.FileInfo(location);

            if(fi.Exists)
            {
                sc.Add(fi.FullName);
                return sc;
            }

            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(location);

            if(di.Exists)
            {
                foreach(System.IO.FileInfo f in di.GetFiles())
                {
                    foreach(string s in getFiles(f.FullName,recursive))
                        sc.Add(s);
                }

                if(recursive)
                {
                    foreach(System.IO.DirectoryInfo d in di.GetDirectories())
                    {
                        foreach(string s in getFiles(d.FullName,recursive))
                            sc.Add(s);
                    }
                }
            }

            return sc;
        }
开发者ID:joshuaphendrix,项目名称:Imagizer,代码行数:34,代码来源:Form1.cs


示例20: ProcessRequest

        public override void ProcessRequest(WebRequest request)
        {
            System.IO.FileInfo info = null;
            if (!String.IsNullOrEmpty(Terraria.Main.worldPathName))
            {
                info = new System.IO.FileInfo(Terraria.Main.worldPathName);
            }

            request.Writer.Buffer(Terraria.Main.worldName ?? String.Empty);
            request.Writer.Buffer(Terraria.Main.maxTilesX);
            request.Writer.Buffer(Terraria.Main.maxTilesY);

            if (info != null && info.Exists)
            {
                request.Writer.Buffer(info.Length);
            }
            else
            {
                request.Writer.Buffer(0L);
            }

            request.Writer.Buffer(Heartbeat.Enabled);
            request.Writer.Buffer(Heartbeat.ServerName);
            request.Writer.Buffer(Heartbeat.ServerDescription);
            request.Writer.Buffer(Heartbeat.ServerDomain);
            request.Writer.Buffer(Heartbeat.PublishToList);

            request.WriteOut();
        }
开发者ID:DeathCradle,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:29,代码来源:Info.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IO.FileStream类代码示例发布时间:2022-05-24
下一篇:
C# IO.DirectoryInfo类代码示例发布时间: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