我试图制作一个程序,该程序将删除文件购买我在运行代码时遇到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