Group29.com - What did you expect?
  Create an account
:: Home  ::  Downloads  ::  Your Account  ::  Forums  ::
Google Adsense
Modules
  • Home
  • Downloads
  • ExpectationReviews
  • Forums
  • Group29 FAQ
  • MovieReviews
  • OtherReviews
  • Stories Archive
  • Submit News
  • Top 10
  • Topics
  • Web Links
  • New at Group29
    ·Movie Review: Buzz Lightyear Movie [10]
    ·Movie Review: The Marvels [7]
    ·UCLA vs. USC 2022 preview
    ·Expectation Review: Black Adam [22]
    ·Tuna Is Not The Favorite Pizza Topping in Minnesota
    ·Expectation Review: Captain Marvel [25]
    ·Forum Topic: Update your Facebook property
    ·Web Link: WEP Key Converter
    ·Forum Topic: Why does my IPA file get saved as a zip file in IE?
    ·Web Link: BeyondCompare

    read more...
    TheForce.Net
    ·Rebelscum Breast Cancer Awareness Charity Patch
    ·BBC Interviews J.J. Abrams About Trek And Wars
    ·CEII: Jabba's Palace Reunion - Massive Guest Announcements
    ·Fathead's May the Fourth Be With You!
    ·Star Wars Night With The Tampa Bay Storm Reminder
    ·Stephen Hayford Star Wars Weekends Exclusive Art
    ·ForceCast #251: To Spoil or Not to Spoil
    ·New Timothy Zahn Audio Books Coming
    ·SDCC: Exclusive Black Series Boba Fett With Han In Carbonite Set
    ·Star Wars Art Exposition May 4th

    read more...
    Hot trends
    ·Group29.com

    read more...
    Group29 Discussion Board :: View topic - Visual C#.NET (C Sharp).NET Useful code snippets
    Log in Register Forum FAQ Memberlist Search
    Ratings, Links, Free Speech and more

    Group29 Discussion Board Forum Index -> Group29 Tech Tips -> Visual C#.NET (C Sharp).NET Useful code snippets
    Post new topic  Reply to topic View previous topic :: View next topic 
    Visual C#.NET (C Sharp).NET Useful code snippets
    PostPosted: Mon Sep 19, 2005 10:15 am Reply with quote
    BB
    Regular
     
    Joined: Jun 23, 2004
    Posts: 340


      


    Here are some useful code items and examples for Microsoft Visual C#.
    View user's profile Visit poster's website
    C# Format Now date and time stamp equivalent to VB.NET
    PostPosted: Mon Sep 19, 2005 10:32 am Reply with quote
    BB
    Regular
     
    Joined: Jun 23, 2004
    Posts: 340


      


    In Visual Basic .NET one carryover in the Now statement that gets a DateTime object with the current date and time. It is very useful to use this information as a string for log file time stamps and unique file names.

    Here is an example where I wanted to create a unique text file called Group29Log.txt for each day. So if today were February 5th, 2005, the file name might look like this:

    Group29Log20050205.txt

    In Visual Basic .NET, the code looks like this:
    Code:
    Dim filename As String
    filename = "Group29Log" & Format(Now, "yyyyMMdd") & ".txt"

    In C#.NET , the code looks like this:
    Code:
    string filename;
    filename = "Group29Log" + String.Format("{0:yyyyMMdd}",DateTime.Now) + ".txt";


    Steve Tibbett has assembled a useful page with all sorts of examples for C# string formatting using the String.Format method.
    http://www.stevex.org/cs/blogs/dottext/articles/158.aspx

    Here is the MSDN .NET Formatting overview
    View user's profile Visit poster's website
    Visual C#.NET (C Sharp).NET Useful code snippets
      Group29 Discussion Board Forum Index -> Group29 Tech Tips
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum
    All times are GMT - 6 Hours  
    Page 1 of 1  

      
      
     Post new topic  Reply to topic  


    Powered by phpBB © 2001-2003 phpBB Group
    Theme created by Vjacheslav Trushkin
    Forums ©
    Group29 Productions

    All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest (c) 2006 by Group29 Productions.


    You can syndicate Group29 Productions news with an RSS Feeder using the file backend.php


    PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
    Page Generation: 0.18 Seconds

    :: HeliusGray phpbb2 style by CyberAlien :: PHP-Nuke theme by www.nukemods.com ::