Una simple implementacion para obtener el ZONE.IDENTIFIER(Windows Zone Identifier File) del archivos.
Ejemplo de Uso:
Using zi As New ZoneIdentifier("D:\Sample.exe")
If zi.Zone = UrlZone.Internet Then
zi.Remove
End If
End Using
El Proyecto esta disponible para descargar: ZoneIdWrapper (https://github.com/fudmario/ZoneIdWrapper)
Si solo quieren eliminar el ZoneIdentifier, pueden usar la API:
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, BestFitMapping:=False, ThrowOnUnmappableChar:=True, SetLastError:=True)>
Public Shared Function DeleteFile(<MarshalAs(UnmanagedType.LPTStr)> ByVal filepath As String
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
Ejemplo de Uso:
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, BestFitMapping:=False, ThrowOnUnmappableChar:=True, SetLastError:=True)>
Public Shared Function DeleteFile(<MarshalAs(UnmanagedType.LPTStr)> ByVal filepath As String
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
Public Function DeleteZoneIdentifier(ByVal filePath As String) As Boolean
Return DeleteFile(filePath + ":Zone.Identifier")
End Function