Inquiridor
ignora erro ao nao axa aquivo no vb.net

Pergunta
-
exemplo
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
My.Computer.FileSystem.DeleteFile("C:\exemple.txt.")End Sub
End Classo exemple.txt foi deletado so que fala que o arquivo não foi encontrado tem como da um ignore no programa se não axá o exemple.txt
Todas as Respostas
-
File.Exists
Leonardo Garcia
pensouweb@hotmail.com -
-
Imports System.IO
Public Class Form1
Private Property curFile As String
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\BugTrap.dll")
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\XTrap\XTrapVa.dll")
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\XTrap\XTrapExt.dll")
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\XTrap\XTrap.xt")
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\XTrap\XDataFI0.Xtp")
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\XTrap\psapi.dll")
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\Shader\Cache.i3GL")
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\Shader\DefaultSHGL")
My.Computer.FileSystem.DeleteFile("C:\ongame\Pointblank\Shader\i3Decl.hlsl")
Console.WriteLine(Se(File.Exists(curFile), ". Arquivo existe", ". Arquivo não existe"))
End Sub
Private Function Se(p1 As Boolean, p2 As String, p3 As String) As Object
Throw New NotImplementedException
End Function
End Classfica assim manow ?
-