Results 1 to 10 of 10
  1. #1
    NitroSmily's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    99
    Reputation
    10
    Thanks
    1,055
    My Mood
    Tired

    Question Converting from VB to C# help!

    Hi guys, I got a problem and I hope you guys can help me with it

    So I released my trainer yesterday and I started thinking changing to C#, so I got the class from @Jorndel and converted the codes.
    I almost made it, but it's just two small problems

    Problem 1:
    If I try to debug the program, this gets a blue underline and it says:
    A using namespace directive can only be applied to namespace; "System.Diagnostics.Process" is a type not a namespace
    Code:
    using System.Diagnostics.Process;
    Now I tried to remove the System.Diagnostics.Process, but then it comes more problems about my Memory class

    Problem 2:
    If try to debug the program, this gets a blue underline and it says:
    Type "WindowsFormsApplication1.Form1" already defines a member called "Form1_Load" with the same parameter types
    Code:
            private void  // ERROR: Handles clauses are not supported in C#
        Form1_Load(System.Object sender, System.EventArgs e)
            {
            }
    When I removed this I got 103 problems, so I'm not going to do that (btw when I delete it it's the MW3.Process_Handle that makes the problem)

    If you have any suggestions or if you know the problem please help me!
    I'm not really good at C# so if you guys can help me out that would be awsome and I will be really happy.

  2. #2
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,940
    Reputation
    574
    Thanks
    5,005
    My Mood
    Twisted
    Quote Originally Posted by NitroSmily View Post
    Hi guys, I got a problem and I hope you guys can help me with it

    So I released my trainer yesterday and I started thinking changing to C#, so I got the class from @Jorndel and converted the codes.
    I almost made it, but it's just two small problems

    Problem 1:
    If I try to debug the program, this gets a blue underline and it says:
    A using namespace directive can only be applied to namespace; "System.Diagnostics.Process" is a type not a namespace
    Code:
    using System.Diagnostics.Process;
    Now I tried to remove the System.Diagnostics.Process, but then it comes more problems about my Memory class
    U'll have to remove it i guess ... These are the ones i use :
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using System****;
    using System.Threading;
    And im able to close, open, etc processes So just convert all the other errors that pop up too ...

    Quote Originally Posted by NitroSmily View Post
    Problem 2:
    If try to debug the program, this gets a blue underline and it says:
    Type "WindowsFormsApplication1.Form1" already defines a member called "Form1_Load" with the same parameter types
    Code:
    private void // ERROR: Handles clauses are not supported in C#
    Form1_Load(System.Object sender, System.EventArgs e)
    {
    }
    When I removed this I got 103 problems, so I'm not going to do that (btw when I delete it it's the MW3.Process_Handle that makes the problem)
    Dont put Process_Handle in the Form.Load ... Just put it inside every button, that way it'll still work when people start ur hack first and then MW3.
    And that error means u double-defined Form.Load ... Just search where the 2nd one is and delete/modify that one
    Last edited by Horror; 10-01-2012 at 11:45 AM.
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  3. #3
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,543
    My Mood
    Angelic
    Quote Originally Posted by NitroSmily View Post
    Hi guys, I got a problem and I hope you guys can help me with it

    So I released my trainer yesterday and I started thinking changing to C#, so I got the class from @Jorndel and converted the codes.
    I almost made it, but it's just two small problems

    Problem 1:
    If I try to debug the program, this gets a blue underline and it says:
    A using namespace directive can only be applied to namespace; "System.Diagnostics.Process" is a type not a namespace
    Code:
    using System.Diagnostics.Process;
    Now I tried to remove the System.Diagnostics.Process, but then it comes more problems about my Memory class

    Problem 2:
    If try to debug the program, this gets a blue underline and it says:
    Type "WindowsFormsApplication1.Form1" already defines a member called "Form1_Load" with the same parameter types
    Code:
            private void  // ERROR: Handles clauses are not supported in C#
        Form1_Load(System.Object sender, System.EventArgs e)
            {
            }
    When I removed this I got 103 problems, so I'm not going to do that (btw when I delete it it's the MW3.Process_Handle that makes the problem)

    If you have any suggestions or if you know the problem please help me!
    I'm not really good at C# so if you guys can help me out that would be awsome and I will be really happy.
    Using Syste.Dia***


    Is auto in VB.
    So just: Process is enough.


    void is not used in VB.

    there you use :


    Sub

    _______


    Why form1 already exsist is because you mostly like made that event in the code already.


    And as said, if you want to convert, you better learn the language a little or google an online converter.
    Last edited by Jorndel; 10-01-2012 at 11:46 AM.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  4. #4
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,940
    Reputation
    574
    Thanks
    5,005
    My Mood
    Twisted
    Quote Originally Posted by Jorndel View Post


    Using Syste.Dia***


    Is auto in VB.
    So just: Process is enough.


    void is not used in VB.

    there you use :


    Sub
    Isnt he converting from VB to C# and not the other way around ?
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  5. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,330
    My Mood
    Breezy
    My advice, start from scratch. Converting existing VB.NET projects to C# is a big bitch, it's too much trouble. If you really don't want to, cut the code from each event (eg. the code inside Form1_Load), delete the event and then re-create them in the designer and paste it back in. This is because VB.NET and C# handle events differently. (eg. VB.NET uses the Handles keyword and C# adds the event inside the form designer code). Also, you should be typing: using System.Diagnostics; in order to use the Process class.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  6. #6
    NitroSmily's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    99
    Reputation
    10
    Thanks
    1,055
    My Mood
    Tired

    Question New Problem with MW3 trainer!

    Quote Originally Posted by master131 View Post
    My advice, start from scratch. Converting existing VB.NET projects to C# is a big bitch, it's too much trouble. If you really don't want to, cut the code from each event (eg. the code inside Form1_Load), delete the event and then re-create them in the designer and paste it back in. This is because VB.NET and C# handle events differently. (eg. VB.NET uses the Handles keyword and C# adds the event inside the form designer code). Also, you should be typing: using System.Diagnostics; in order to use the Process class.
    Ok I'm going to do as you said, but now comes a new error when I start from begining

  7. #7
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,751
    Reputation
    66
    Thanks
    14,311
    My Mood
    Angelic
    Quote Originally Posted by NitroSmily View Post
    Ok I'm going to do as you said, but now comes a new error when I start from begining
    That's a warning.. not an error


    CoD Minion from 09/19/2012 to 01/10/2013

  8. The Following User Says Thank You to MarkHC For This Useful Post:

    [MPGH]Jorndel (10-01-2012)

  9. #8
    NitroSmily's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    99
    Reputation
    10
    Thanks
    1,055
    My Mood
    Tired
    Quote Originally Posted by -InSaNe- View Post

    That's a warning.. not an error
    I know it's a warning but it doesn't let me debug

  10. #9
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,330
    My Mood
    Breezy
    Have you installed Visual Studio 11 Developer Preview or something? It is a known bug for that to happen. Uninstall it and re-install VS2010 or install the proper release version of Visual Studio 11. For now, just right-click on the project in the Solution Explorer > Properties > Build > Treat Warnings as Errors > None.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  11. #10
    Reflex-'s Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    192.168.1.01
    Posts
    6,633
    Reputation
    584
    Thanks
    2,261
    My Mood
    Dead
    To end this, I Would be willing to TeamView to help you solve this issue.

  12. The Following User Says Thank You to Reflex- For This Useful Post:

    [MPGH]Jorndel (10-01-2012)

Similar Threads

  1. [Solved] I got banned from MW3 for ever! Help
    By mama11 in forum Call of Duty Modern Warfare 3 Help
    Replies: 8
    Last Post: 04-01-2012, 06:47 PM
  2. I need help converting from xbox to PC
    By zMMz Maniac in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 2
    Last Post: 10-20-2010, 11:56 AM
  3. I need help from anyone that can help.
    By brobbins in forum Combat Arms Help
    Replies: 3
    Last Post: 09-03-2010, 11:16 AM
  4. [Help] Converting from txt to gct?
    By ppl2pass in forum Visual Basic Programming
    Replies: 10
    Last Post: 05-11-2010, 02:48 AM
  5. Hackers from China for Seeking help
    By jzzzr501 in forum Alliance of Valiant Arms (AVA) Hacks & Cheats
    Replies: 22
    Last Post: 02-15-2010, 04:09 AM

Tags for this Thread