JImmy PoP Posted November 14, 2003 Posted November 14, 2003 (edited) I am getting pretty good pretty fast with asp.net but how do i get the date month and year as a string, i need them in seperate variables, year as 20XX, month as XX, day as XX can anyone help? one last question, will this when it saves make a new dir if it doesnt exist? if no how do i make it do so? If Not (File16.PostedFile Is Nothing) Then File16.PostedFile.SaveAs("c:\upload\" Region & "\" & Tech & "\" & DATE "\J4QC3.jpg") lblMsg16.Text = "Job 4 QC 3 Upload successfull." End If Thanks, Jimmy Edited November 14, 2003 by Robby Quote
Moderators Robby Posted November 14, 2003 Moderators Posted November 14, 2003 I don't have .NET right now, but it's something like.... Now.Month Now.Day etc.. Quote Visit...Bassic Software
Administrators PlausiblyDamp Posted November 14, 2003 Administrators Posted November 14, 2003 system.IO.Directory.CreateDirectory will allow you to create a new folder. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
WeaKness Posted November 14, 2003 Posted November 14, 2003 system.IO.Directory.CreateDirectory will allow you to create a new folder. how to specify for which dirs to make, region, tech, year and month will most likely already be there, how to check and make sure that those folders are there and if not create one? or just specify the command and c:\uploads\year\month\day and it will make just the day since thats all it needs? and maybe an example? please respond, thanks in advance Quote
Administrators PlausiblyDamp Posted November 14, 2003 Administrators Posted November 14, 2003 System.IO.Directory.CreateDirectory("c:\test\x\y\z") it will create the entire structure if it doesn't exist. Probably would have been quicker to try it than wait for a response.... Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
JImmy PoP Posted November 15, 2003 Author Posted November 15, 2003 uh oh where did i goof? it makes the files even if nothing is in the file box? HELP? I am getting pretty good pretty fast with asp.net but how do i get the date month and year as a string, i need them in seperate variables, year as 20XX, month as XX, day as XX can anyone help? one last question, will this when it saves make a new dir if it doesnt exist? if no how do i make it do so? If Not (File16.PostedFile Is Nothing) Then File16.PostedFile.SaveAs("c:\upload\" Region & "\" & Tech & "\" & DATE "\J4QC3.jpg") lblMsg16.Text = "Job 4 QC 3 Upload successfull." End If Thanks, Jimmy Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.