Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 Concetating timestamp using Application Startup Path

$
0
0
Hey guys -

I have tried many combinations of syntax to try to take this (100% working) code:
Code:

SaveScreen(Application.StartupPath & "\screen.png")
into code that inserts a timestamp (system.datetime.now) after the filename "screen". It's just not working for some reason.

I thought it should be something like
Code:

SaveScreen(Application.StartupPath & "\screen('" & System.DateTime.Now & "').png")
or maybe even
Code:

  SaveScreen(Application.StartupPath & "\screen('" & System.DateTime.Now.tostring() & "').png")
but neither of these are working. I've also tried storing the system.datetime.now.tostring into a string variable and using that in this syntax. What am I doing wrong? I just want to write a precise timestamp onto the end of the filename (the standard windows explorer "datemodified" doesn't show seconds, and I need seconds to know when the save occured and to write unique file names each time!)

Thanks!

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>