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. General Programming
  3. C#
  4. Cant use System.Windows

Cant use System.Windows

Scheduled Pinned Locked Moved C#
help
10 Posts 4 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.
  • A Offline
    A Offline
    ayandelhi
    wrote on last edited by
    #1

    Hi!! i'm back to disturb u again... This time i wanna know y cant i use System.windows in a console program.. wheneva i type this it shows error.. that it doesn't exists.. but when i choose window application. i uses it... help me out..i need to use it...

    P L A 3 Replies Last reply
    0
    • A ayandelhi

      Hi!! i'm back to disturb u again... This time i wanna know y cant i use System.windows in a console program.. wheneva i type this it shows error.. that it doesn't exists.. but when i choose window application. i uses it... help me out..i need to use it...

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You need to add it as a reference. By default, it doesn't get added to console applications. Why would it? They aren't responsible for drawing windows after all.

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

      My blog | My articles | MoXAML PowerToys | Onyx

      A 1 Reply Last reply
      0
      • P Pete OHanlon

        You need to add it as a reference. By default, it doesn't get added to console applications. Why would it? They aren't responsible for drawing windows after all.

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

        My blog | My articles | MoXAML PowerToys | Onyx

        A Offline
        A Offline
        ayandelhi
        wrote on last edited by
        #3

        how??? i m working on keyloggers... so need to write a console program for it... thats y... i'm using System.Windows.Forms.Keys... but cant use it... as mentioned...

        P 1 Reply Last reply
        0
        • A ayandelhi

          Hi!! i'm back to disturb u again... This time i wanna know y cant i use System.windows in a console program.. wheneva i type this it shows error.. that it doesn't exists.. but when i choose window application. i uses it... help me out..i need to use it...

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          A console application does not include Windows by default. You need to add it to the References section of your project in order to use it. However, if you are developing an application that needs Windows why would you start with a console app?

          It's time for a new signature.

          A 1 Reply Last reply
          0
          • L Lost User

            A console application does not include Windows by default. You need to add it to the References section of your project in order to use it. However, if you are developing an application that needs Windows why would you start with a console app?

            It's time for a new signature.

            A Offline
            A Offline
            ayandelhi
            wrote on last edited by
            #5

            sir, thats m asking.. how shud i... actually i'm new to VS2008 and C#.. thats y stuck here...

            L 1 Reply Last reply
            0
            • A ayandelhi

              Hi!! i'm back to disturb u again... This time i wanna know y cant i use System.windows in a console program.. wheneva i type this it shows error.. that it doesn't exists.. but when i choose window application. i uses it... help me out..i need to use it...

              A Offline
              A Offline
              ayandelhi
              wrote on last edited by
              #6

              i found an answer... right click on the solution and then add reference of System.Windows.Forms this solves my problem..

              1 Reply Last reply
              0
              • A ayandelhi

                how??? i m working on keyloggers... so need to write a console program for it... thats y... i'm using System.Windows.Forms.Keys... but cant use it... as mentioned...

                P Offline
                P Offline
                Paladin2000
                wrote on last edited by
                #7

                In your solution explorer, right-click References (looks like a folder), Add Reference. Then find the one you need. I will advise you that using keyloggers maliciously (such as to spy on someone, steal passwords etc) is ill-advised, and probably illegal.

                1 Reply Last reply
                0
                • A ayandelhi

                  sir, thats m asking.. how shud i... actually i'm new to VS2008 and C#.. thats y stuck here...

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Well, I wonder how you expect to write a working application if you do not understand the basics. However

                  • Use your mouse to right-click on the References item in Solution Explorer.
                  • Select the .NET tab in the popup dialog.
                  • Scroll down to System.Windows.Forms, and select it.
                  • Click on OK.
                  • Add the using statement to your source module.

                  [edit]Did I say something wrong here? Got a 1 vote for it anyway[/edit]

                  It's time for a new signature.

                  modified on Thursday, July 1, 2010 1:57 PM

                  P 1 Reply Last reply
                  0
                  • L Lost User

                    Well, I wonder how you expect to write a working application if you do not understand the basics. However

                    • Use your mouse to right-click on the References item in Solution Explorer.
                    • Select the .NET tab in the popup dialog.
                    • Scroll down to System.Windows.Forms, and select it.
                    • Click on OK.
                    • Add the using statement to your source module.

                    [edit]Did I say something wrong here? Got a 1 vote for it anyway[/edit]

                    It's time for a new signature.

                    modified on Thursday, July 1, 2010 1:57 PM

                    P Offline
                    P Offline
                    Paladin2000
                    wrote on last edited by
                    #9

                    I have noticed that some people down-vote things they don't want to hear, regardless of veracity or technical merit. I wouldn't let it get you down.

                    L 1 Reply Last reply
                    0
                    • P Paladin2000

                      I have noticed that some people down-vote things they don't want to hear, regardless of veracity or technical merit. I wouldn't let it get you down.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Timothy CIAN wrote:

                      I wouldn't let it get you down.

                      Oh, it doesn't; I make too many mistakes to worry about criticism. I would just prefer to have an explanation of what I did wrong.

                      It's time for a new signature.

                      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