vb.net - XML with links & VB search & delete files extention -


i have xml file has paths files kept.

<root>     <filename>          <location>e:\test\</location>     </filename> </root> 

using xml file, want vb use link search *.txt, *.log, *.csv file extensions. deleting code follows.

nb: i'm scripting in ssis.

imports system imports system.data imports system.math imports microsoft.sqlserver.dts.runtime imports system.xml imports system.io   public sub main()     try          each f in directory.getfiles("c:\test\sample", "*.log", searchoption.alldirectories)             system.io.file.getlastwritetime("c:\test\sample").tolocaltime()             file.delete(f)         next      catch ex unauthorizedaccessexception         msgbox(ex.message)     end try      dts.taskresult = scriptresults.success end sub 

end class

how delete file in vb.net:

        try             file.delete(pathandfile)         catch ex exception             msgbox(ex.message)         end try 

to age of file:

       msgbox(system.io.file.getlastwritetime("c:\pagefile.sys").tolocaltime) 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -