Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Picking Up C# or How I typed my fingers to the bone

Picking Up C# or How I typed my fingers to the bone

Scheduled Pinned Locked Moved The Lounge
csharpquestionworkspace
24 Posts 15 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D dnmanner

    betterc wrote: But I really had to grin when I googled to find that to get my application path I needed to enter: string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); Environment.CurrentDirectory also gets the application path. It's a bit easier on the keyboard. :) betterc wrote: I think we need a contest on what is the longest statement possible in c# to retrieve a smiple result. There are 8 dots between the = sign and the ; in the above snippet. I once came across (alright, wrote :|) this code to decrypt a file: string Decrypted = System.Text.ASCIIEncoding.ASCII.GetString(new System.Security.Cryptography.TripleDESCryptoServiceProvider().CreateDecryptor(System.Text.Encoding.ASCII.GetBytes(xdoc.SelectSingleNode(System.Configuration.ConfigurationSettings.AppSettings["key"]).InnerText), System.Text.Encoding.ASCII.GetBytes(xdoc.SelectSingleNode(System.Configuration.ConfigurationSettings.AppSettings["iv"]).InnerText)).TransformFinalBlock(System.Convert.FromBase64String(System.IO.File.OpenText(System.Configuration.ConfigurationSettings.AppSettings["filepath"]).ReadToEnd()), 0, System.Configuration.ConfigurationSettings.AppSettings["length"])); Dan

    P Offline
    P Offline
    Paul Watson
    wrote on last edited by
    #21

    > once came across (alright, wrote :laugh: :laugh: :laugh: I love the way you said that, can just picture it in my head. regards, Paul Watson Bluegrass South Africa Ian Darling wrote: "and our loonies usually end up doing things like Monty Python." Crikey! ain't life grand?

    1 Reply Last reply
    0
    • B betterc

      I'm an old guy. I've gone up the technical ranks to run a couple of significant software development groups; suffered the crash and now code for a living. I haven't coded in every programing language known, but then, I've got quite a few nothes on my pocket protector. I love C# but I don't think I've typed so much since the days of 'Big 8' COBOL. I get a chuckle on how much I have to type to get something so small done. I thought I'd seen everything when I found that a \n\r was replaced by an 'Environment.Linefeed'. But I really had to grin when I googled to find that to get my application path I needed to enter: string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); It works but I think I've only got another C# project before I'll need to replace my keyboard. I think we need a contest on what is the longest statement possible in c# to retrieve a smiple result. There are 8 dots between the = sign and the ; in the above snippet. :-D:-D:-D:-D

      S Offline
      S Offline
      sreejith ss nair
      wrote on last edited by
      #22

      Pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee;P ************************** S r e e j i t h N a i r **************************

      1 Reply Last reply
      0
      • D dnmanner

        betterc wrote: But I really had to grin when I googled to find that to get my application path I needed to enter: string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); Environment.CurrentDirectory also gets the application path. It's a bit easier on the keyboard. :) betterc wrote: I think we need a contest on what is the longest statement possible in c# to retrieve a smiple result. There are 8 dots between the = sign and the ; in the above snippet. I once came across (alright, wrote :|) this code to decrypt a file: string Decrypted = System.Text.ASCIIEncoding.ASCII.GetString(new System.Security.Cryptography.TripleDESCryptoServiceProvider().CreateDecryptor(System.Text.Encoding.ASCII.GetBytes(xdoc.SelectSingleNode(System.Configuration.ConfigurationSettings.AppSettings["key"]).InnerText), System.Text.Encoding.ASCII.GetBytes(xdoc.SelectSingleNode(System.Configuration.ConfigurationSettings.AppSettings["iv"]).InnerText)).TransformFinalBlock(System.Convert.FromBase64String(System.IO.File.OpenText(System.Configuration.ConfigurationSettings.AppSettings["filepath"]).ReadToEnd()), 0, System.Configuration.ConfigurationSettings.AppSettings["length"])); Dan

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #23

        dnmanner wrote: Environment.CurrentDirectory also gets the application path. You really must learn the difference between the current directory and the application path. An application can set the current directory, it cannot set it's own path.


        [

        ](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!

        Within you lies the power for good; Use it!

        1 Reply Last reply
        0
        • R Ryan Binns

          So you use House.Floor() instead of Math.Floor() ? ;P :rolleyes:

          Ryan

          "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

          J Offline
          J Offline
          Jon Pawley
          wrote on last edited by
          #24

          ;P

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups