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. Few focused questions

Few focused questions

Scheduled Pinned Locked Moved C#
questioncsharpsecurity
8 Posts 3 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.
  • N Offline
    N Offline
    NaNg15241
    wrote on last edited by
    #1

    Hey all... I know a little C#, I've been working with it for 2 years (still at school, 11th grade), I'm pretty expirienced but still I don't know alot... I'm building all my programs on VC# express, which as you know, has built-in publisher, with built-in installation, well, I wanna do a few things out of the small box it shows me, so here are some questions that I remember now, that I would like answers to them, and appriciate if you would answer, or give me a link for it: 1. How can I register my program in such a way, that the computer will know that files with endings such as what I want(i.e .ysl) will have an icon that I want? 2. How can I register my program in such a way, that I can put an option of "Start with Windows startup"? 3. What is the BEST way to make sure that my program is only run ONCE in the computer, and that no-one will be able to open another copy will the first one is running? 4. How can I open a process (System.Diagnostics.Process), and make sure it's an internet explorer program, such as IE or NetScape no-matter to the program he use (IF statements will be accepted), and open it in a URL I want? 5. How can I tell who implements ICryptoTransform (System.Security.Cryptography.ICryptoTransform) without checking at Microsoft's MSDN for each and every one? and what is the best way to encode (Crypt) my code (what is the best ICryptoTransform implementing class to do it)? 6. Where can I find default icons such as SaveAs... (three discates), Save (one discate), open (folder), new (page) etc...? well... that's enough for now... if I'll remember some more I will ask... THANKS IN ADVANCE FOR ALL THE ANSWERS!!!! -- modified at 15:51 Monday 8th May, 2006

    N S D 3 Replies Last reply
    0
    • N NaNg15241

      Hey all... I know a little C#, I've been working with it for 2 years (still at school, 11th grade), I'm pretty expirienced but still I don't know alot... I'm building all my programs on VC# express, which as you know, has built-in publisher, with built-in installation, well, I wanna do a few things out of the small box it shows me, so here are some questions that I remember now, that I would like answers to them, and appriciate if you would answer, or give me a link for it: 1. How can I register my program in such a way, that the computer will know that files with endings such as what I want(i.e .ysl) will have an icon that I want? 2. How can I register my program in such a way, that I can put an option of "Start with Windows startup"? 3. What is the BEST way to make sure that my program is only run ONCE in the computer, and that no-one will be able to open another copy will the first one is running? 4. How can I open a process (System.Diagnostics.Process), and make sure it's an internet explorer program, such as IE or NetScape no-matter to the program he use (IF statements will be accepted), and open it in a URL I want? 5. How can I tell who implements ICryptoTransform (System.Security.Cryptography.ICryptoTransform) without checking at Microsoft's MSDN for each and every one? and what is the best way to encode (Crypt) my code (what is the best ICryptoTransform implementing class to do it)? 6. Where can I find default icons such as SaveAs... (three discates), Save (one discate), open (folder), new (page) etc...? well... that's enough for now... if I'll remember some more I will ask... THANKS IN ADVANCE FOR ALL THE ANSWERS!!!! -- modified at 15:51 Monday 8th May, 2006

      N Offline
      N Offline
      NaNg15241
      wrote on last edited by
      #2

      sorry for the multiple posting, the site said and error and I thought it didn't post it, if the admin can erase one please, but leave one also, that would be lovely :D ... thanks...

      S 1 Reply Last reply
      0
      • N NaNg15241

        sorry for the multiple posting, the site said and error and I thought it didn't post it, if the admin can erase one please, but leave one also, that would be lovely :D ... thanks...

        S Offline
        S Offline
        Stefan Troschuetz
        wrote on last edited by
        #3

        This happens from time to time. You can erase your postings on your own. There is a delete link at the right side of bottom edge.


        "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

        www.troschuetz.de

        1 Reply Last reply
        0
        • N NaNg15241

          Hey all... I know a little C#, I've been working with it for 2 years (still at school, 11th grade), I'm pretty expirienced but still I don't know alot... I'm building all my programs on VC# express, which as you know, has built-in publisher, with built-in installation, well, I wanna do a few things out of the small box it shows me, so here are some questions that I remember now, that I would like answers to them, and appriciate if you would answer, or give me a link for it: 1. How can I register my program in such a way, that the computer will know that files with endings such as what I want(i.e .ysl) will have an icon that I want? 2. How can I register my program in such a way, that I can put an option of "Start with Windows startup"? 3. What is the BEST way to make sure that my program is only run ONCE in the computer, and that no-one will be able to open another copy will the first one is running? 4. How can I open a process (System.Diagnostics.Process), and make sure it's an internet explorer program, such as IE or NetScape no-matter to the program he use (IF statements will be accepted), and open it in a URL I want? 5. How can I tell who implements ICryptoTransform (System.Security.Cryptography.ICryptoTransform) without checking at Microsoft's MSDN for each and every one? and what is the best way to encode (Crypt) my code (what is the best ICryptoTransform implementing class to do it)? 6. Where can I find default icons such as SaveAs... (three discates), Save (one discate), open (folder), new (page) etc...? well... that's enough for now... if I'll remember some more I will ask... THANKS IN ADVANCE FOR ALL THE ANSWERS!!!! -- modified at 15:51 Monday 8th May, 2006

          S Offline
          S Offline
          Stefan Troschuetz
          wrote on last edited by
          #4

          3. Search for "single instance" here on Code Project. There are some articles covering this topic. (By the way this should be done everytime before asking a question in the forum). 1. I think there are articles too which cover this topic. 2. Where do you want to put this option? If you want to start your application with windows startup, simply create an appropriate link in the Autostart folder of startmenu. 4. Process.Start("www.troschuetz.de"); //Opens URL with standard browser 6. Not sure, but maybe searching for "*.ico" on C-partition brings some results. Also googling for "ico" or "icon" and "SaveAs", "Save" or ... may be worth a try.


          "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

          www.troschuetz.de

          1 Reply Last reply
          0
          • N NaNg15241

            Hey all... I know a little C#, I've been working with it for 2 years (still at school, 11th grade), I'm pretty expirienced but still I don't know alot... I'm building all my programs on VC# express, which as you know, has built-in publisher, with built-in installation, well, I wanna do a few things out of the small box it shows me, so here are some questions that I remember now, that I would like answers to them, and appriciate if you would answer, or give me a link for it: 1. How can I register my program in such a way, that the computer will know that files with endings such as what I want(i.e .ysl) will have an icon that I want? 2. How can I register my program in such a way, that I can put an option of "Start with Windows startup"? 3. What is the BEST way to make sure that my program is only run ONCE in the computer, and that no-one will be able to open another copy will the first one is running? 4. How can I open a process (System.Diagnostics.Process), and make sure it's an internet explorer program, such as IE or NetScape no-matter to the program he use (IF statements will be accepted), and open it in a URL I want? 5. How can I tell who implements ICryptoTransform (System.Security.Cryptography.ICryptoTransform) without checking at Microsoft's MSDN for each and every one? and what is the best way to encode (Crypt) my code (what is the best ICryptoTransform implementing class to do it)? 6. Where can I find default icons such as SaveAs... (three discates), Save (one discate), open (folder), new (page) etc...? well... that's enough for now... if I'll remember some more I will ask... THANKS IN ADVANCE FOR ALL THE ANSWERS!!!! -- modified at 15:51 Monday 8th May, 2006

            D Offline
            D Offline
            DigitalKing
            wrote on last edited by
            #5

            1. Create some registry entries under HKEY_CLASSES_ROOT:

            This can all be done programatically, but it takes some work. Look at the Microsoft.Win32 namespace for registry manipulation functions.

            1. Create a key by the name of the file extension you want
            2. Set the default attribute of this key to a word that describes your program. It's name doesn't really matter.
            3. Create a key by the name of the word you decided on in step 2.
            4. Create some subkeys: 'DefaultIcon' and 'shell'
            5. Set the default attribute of the DefaultIcon key to the path of your icon. If you want to use the the same icon
              as your executable, do something like this: c:\code\mysupercoolapp\exefile.exe,0
            6. Create a 'open' subkey under 'shell' and a 'command' subkey under open
            7. Set the default attribute of the 'command' key to the path of your program (include the %1) c:\code\mysupercoolapp\exefile.exe %1
            8. Restart
            9. When a file with the extension you've picked is double-clicked, your application will run.
              The first argument will be the path of the file.

            2. You can put a link in the startup folder of the start menu, or add a registry entry to either HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run (if you want it to run whenever the computer starts) or HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run (if you want it to run whenever only the current user logs on) 3. As the other post-er said, search for "single instance" 4. System.Diagnostics.Process.Start("http://www.myurl.com"); will open the url in the default web browser 5. I should read up on cryptography 6. They are in a zip file in Visual Studio's program folder: C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary\VS2005ImageLibrary.zip (or similar) Hope this helps, DigitalKing

            N 2 Replies Last reply
            0
            • D DigitalKing

              1. Create some registry entries under HKEY_CLASSES_ROOT:

              This can all be done programatically, but it takes some work. Look at the Microsoft.Win32 namespace for registry manipulation functions.

              1. Create a key by the name of the file extension you want
              2. Set the default attribute of this key to a word that describes your program. It's name doesn't really matter.
              3. Create a key by the name of the word you decided on in step 2.
              4. Create some subkeys: 'DefaultIcon' and 'shell'
              5. Set the default attribute of the DefaultIcon key to the path of your icon. If you want to use the the same icon
                as your executable, do something like this: c:\code\mysupercoolapp\exefile.exe,0
              6. Create a 'open' subkey under 'shell' and a 'command' subkey under open
              7. Set the default attribute of the 'command' key to the path of your program (include the %1) c:\code\mysupercoolapp\exefile.exe %1
              8. Restart
              9. When a file with the extension you've picked is double-clicked, your application will run.
                The first argument will be the path of the file.

              2. You can put a link in the startup folder of the start menu, or add a registry entry to either HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run (if you want it to run whenever the computer starts) or HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run (if you want it to run whenever only the current user logs on) 3. As the other post-er said, search for "single instance" 4. System.Diagnostics.Process.Start("http://www.myurl.com"); will open the url in the default web browser 5. I should read up on cryptography 6. They are in a zip file in Visual Studio's program folder: C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary\VS2005ImageLibrary.zip (or similar) Hope this helps, DigitalKing

              N Offline
              N Offline
              NaNg15241
              wrote on last edited by
              #6

              thank you very very very very very very very very much!!! Both of you!

              1 Reply Last reply
              0
              • D DigitalKing

                1. Create some registry entries under HKEY_CLASSES_ROOT:

                This can all be done programatically, but it takes some work. Look at the Microsoft.Win32 namespace for registry manipulation functions.

                1. Create a key by the name of the file extension you want
                2. Set the default attribute of this key to a word that describes your program. It's name doesn't really matter.
                3. Create a key by the name of the word you decided on in step 2.
                4. Create some subkeys: 'DefaultIcon' and 'shell'
                5. Set the default attribute of the DefaultIcon key to the path of your icon. If you want to use the the same icon
                  as your executable, do something like this: c:\code\mysupercoolapp\exefile.exe,0
                6. Create a 'open' subkey under 'shell' and a 'command' subkey under open
                7. Set the default attribute of the 'command' key to the path of your program (include the %1) c:\code\mysupercoolapp\exefile.exe %1
                8. Restart
                9. When a file with the extension you've picked is double-clicked, your application will run.
                  The first argument will be the path of the file.

                2. You can put a link in the startup folder of the start menu, or add a registry entry to either HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run (if you want it to run whenever the computer starts) or HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run (if you want it to run whenever only the current user logs on) 3. As the other post-er said, search for "single instance" 4. System.Diagnostics.Process.Start("http://www.myurl.com"); will open the url in the default web browser 5. I should read up on cryptography 6. They are in a zip file in Visual Studio's program folder: C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary\VS2005ImageLibrary.zip (or similar) Hope this helps, DigitalKing

                N Offline
                N Offline
                NaNg15241
                wrote on last edited by
                #7

                the Process.Start("http://..."); method is opening the URL in the already opened browsers, how can I turn it to new browsers?

                D 1 Reply Last reply
                0
                • N NaNg15241

                  the Process.Start("http://..."); method is opening the URL in the already opened browsers, how can I turn it to new browsers?

                  D Offline
                  D Offline
                  DigitalKing
                  wrote on last edited by
                  #8

                  There's no good way to accomplish this, as it is the user's preference. For example, in firefox, the user can select whether to load newly opened pages in the current tab, or a new tab.

                  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