{"id":85,"date":"2012-02-23T07:11:10","date_gmt":"2012-02-23T13:11:10","guid":{"rendered":"https:\/\/www.asberry.org\/blog_tech\/?p=85"},"modified":"2012-02-23T07:15:59","modified_gmt":"2012-02-23T13:15:59","slug":"archiving-a-file-in-visual-basic","status":"publish","type":"post","link":"https:\/\/asberry.org\/blog_tech\/?p=85","title":{"rendered":"Archiving a file in Visual Basic"},"content":{"rendered":"<pre class=\"brush: vb; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\nImports System\r\nImports System.Data\r\nImports System.Math\r\nImports Microsoft.SqlServer.Dts.Runtime\r\nImports System.IO\r\n\r\n&lt;System.AddIn.AddIn(&quot;ScriptMain&quot;, Version:=&quot;1.0&quot;, Publisher:=&quot;&quot;, Description:=&quot;&quot;)&gt; _\r\n&lt;System.CLSCompliantAttribute(False)&gt; _\r\nPartial Public Class ScriptMain\r\n Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase\r\n\r\nEnum ScriptResults\r\n Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success\r\n Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure\r\n End Enum\r\n\r\nPublic Sub Main()\r\n\r\nDim sOriginalFile, sArchivedFile, sDate As String\r\n\r\nsOriginalFile = &quot;C:\\Taleo\\TCC\\Prod\\Export\\Requisition\\Requisition.csv&quot;\r\n sDate = Year(Date.Today()).ToString() &amp; Right(&quot;0&quot; &amp; Month(Date.Today()), 2) &amp; Right(&quot;0&quot; &amp; Microsoft.VisualBasic.DateAndTime.Day(Date.Today()), 2) &amp; &quot;_&quot; &amp; Hour(Now) &amp; &quot;_&quot; &amp; Minute(Now) &amp; &quot;_&quot; &amp; Second(Now)\r\n sArchivedFile = &quot;C:\\Taleo\\TCC\\Prod\\Export\\Requisition\\Archive\\ReqExport\\Requisition-&quot; &amp; sDate &amp; &quot;.csv&quot;\r\n\r\nFile.Move(sOriginalFile, sArchivedFile)\r\n\r\nDts.TaskResult = ScriptResults.Success\r\n End Sub\r\n\r\nEnd Class\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Imports System.IO &lt;System.AddIn.AddIn(&quot;ScriptMain&quot;, Version:=&quot;1.0&quot;, Publisher:=&quot;&quot;, Description:=&quot;&quot;)&gt; _ &lt;System.CLSCompliantAttribute(False)&gt; _ Partial Public Class ScriptMain Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase Enum ScriptResults Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure End Enum Public Sub Main() Dim sOriginalFile, sArchivedFile, sDate As String sOriginalFile = &quot;C:\\Taleo\\TCC\\Prod\\Export\\Requisition\\Requisition.csv&quot; sDate = Year(Date.Today()).ToString() &amp; Right(&quot;0&quot; &amp; Month(Date.Today()), 2) &amp; Right(&quot;0&quot; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[9],"tags":[],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-visual-basic","author-aron"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4bBkH-1n","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":2,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":90,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions\/90"}],"wp:attachment":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}