File.SetCreationTimeUtc vb.net入門

File.SetCreationTimeUtc

ファイルが作成された日付と時刻を世界協定時刻 (UTC) で設定します。

第一引数はパス
第二引数はSystem.DateTime

構文
File.SetCreationTimeUtc(パス, System.DateTime)

今回はNowを使うことにしました。

ソース
Imports System.IO

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

File.SetCreationTimeUtc(“C:\Users\user\Desktop\hoge3.txt”, Now)

MsgBox(File.GetCreationTimeUtc(“C:\Users\user\Desktop\hoge3.txt”).ToString)
End Sub

End Class

実行結果は
実行時の時間が表示されます。

シェアする

  • このエントリーをはてなブックマークに追加

フォローする

Translate »