我試圖製作一個程序,該程序將刪除文件購買我在運行代碼時遇到System.IO.FileSystemInfo.Exists cannot be used like a method
異常。System.IO.FileSystemInfo.Exists'不能像方法一樣使用
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
FileInfo HealthIcon = new FileInfo(@"Holo\Normal\hud_health.texture");
FileInfo file = new FileInfo(@"hud_health.texture");
///hud icons textures(Normal)
private void button1_Click(object sender, EventArgs e) ///Health icon normal
{
///Health icon textures(Normal)
if (HealthIcon.Exists(@"C:\Program Files (x86)\Steam\steamapps\common\PAYDAY 2\assets\mod_overrides\HoloHud\guis\textures\pd2\hud_health.texture"))
{
file.Delete(@"C:\Program Files (x86)\Steam\steamapps\common\PAYDAY 2\assets\mod_overrides\HoloHud\guis\textures\pd2\hud_health.texture");
}
HealthIcon.CopyTo(@"C:\Program Files (x86)\Steam\steamapps\common\PAYDAY 2\assets\mod_overrides\HoloHud\guis\textures\pd2"); ///Health icon Normal
}
}
[非可調用成員'System.IO.FileSystemInfo.Exists'的可能重複不能像方法一樣使用](http://stackoverflow.com/questions/28459343/non-invocable-member-system-io- filesysteminfo-exists-can-be-used-like-a-met) – 2015-02-11 17:59:48
另一個問題已經擱置,沒有答案。它應該可能只是被刪除。 – 2015-02-11 18:03:37