Results 1 to 15 of 15
  1. #1
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused

    [Help].net framework

    Ok so my friend who has .Net framework 4.0 gets an error every time he runs an application of mine that connects to the internet (i am on .net 3.5) would this be caused by the .net framework difference? and if it is how would i fix it? and also if i code a project in VB2010 on .net 4.0 will people with .net 3.5 be able to run it? Thanks & Rep for best answer

  2. #2
    khaozizleet's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    40
    Reputation
    10
    Thanks
    0
    My Mood
    Blah
    No, .NET 4 will be able to run .NET 3.5.

    If you compile the application using .NET 4.0 you are going to need it.

    You can change that setting in 2010 by Solution Explorer > My Project > Compile > Advanced Compile Options > Target Framework.

  3. #3
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by khaozizleet View Post
    No, .NET 4 will be able to run .NET 3.5.

    If you compile the application using .NET 4.0 you are going to need it.

    You can change that setting in 2010 by Solution Explorer > My Project > Compile > Advanced Compile Options > Target Framework.
    Hmm, everytime he runs it it gives him an error saying it cannot connect to the server yet on other peoples PC's who don't have V 4 installed it runs fine

  4. #4
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    It could be a firewall that's preventing your program accessing the internet?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  5. #5
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    I think he may need to repair his .NET installation. .NET 4.0 will not cause this problem. Plus, if he has firewall, windows will ask for the permission it self to allow or deny that application. If not, you can always use the following code on form's load event to make sure windows adds it automatically or atleast ask for it:

    [php]
    Public Sub ActivateFirewall()
    Dim actFW As INetFwProfile
    actFW = GetProfile()
    actFW.FirewallEnabled = True
    End Sub

    Public Function GetProfile() As NetFwTypeLib.INetFwProfile
    Dim oINetPolicy As NetFwTypeLib.INetFwPolicy
    Dim oINetFwMgr As NetFwTypeLib.INetFwMgr
    oINetFwMgr = GetFwMgr()
    oINetPolicy = oINetFwMgr.LocalPolicy
    Return oINetPolicy.CurrentProfile
    End Function

    Sub AddToFireWall()
    Dim appType As Type = Type.GetTypeFromProgID("HnetCfg.FwAuthorizedApplic ation")
    Dim app As INetFwAuthorizedApplication
    app = DirectCast(Activator.CreateInstance(appType), INetFwAuthorizedApplication)
    app.Name = "MPGHLC - MainWin"
    app.ProcessImageFileName = Application.ExecutablePath
    app.Scope = NET_FW_SCOPE_.NET_FW_SCOPE_ALL
    app.Enabled = True
    Dim apps As INetFwAuthorizedApplications
    Dim fwMgrType As Type = Type.GetTypeFromProgID("HnetCfg.FwMgr")
    Dim fwMgr As INetFwMgr
    fwMgr = DirectCast(Activator.CreateInstance(fwMgrType), INetFwMgr)
    apps = fwMgr.LocalPolicy.CurrentProfile.AuthorizedApplica tions
    apps.Add(app)
    End Sub[/php]
    To make this code work, you need to add reference to "NetFwTypeLib" library that comes with every version of Windows. It is located in:

    Code:
    "C:\windows\system32\Hnetcfg.dll"
    First call the ActivateFirewall method, then call AddToFirewall.

    I recommend you add this to your application, so it will allow your application to connect to internet automatically. I used it in two of my recent applications and it worked great. Also, ask your friend to repair his installation at the first place.
    Last edited by Hassan; 01-15-2011 at 12:02 AM.

  6. The Following 4 Users Say Thank You to Hassan For This Useful Post:

    Blubb1337 (01-15-2011),Jason (01-15-2011),Lolland (01-15-2011),[MPGH]master131 (01-15-2011)

  7. #6
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,672
    My Mood
    Breezy
    Quote Originally Posted by Hassan View Post
    I think he may need to repair his .NET installation. .NET 4.0 will not cause this problem. Plus, if he has firewall, windows will ask for the permission it self to allow or deny that application. If not, you can always use the following code on form's load event to make sure windows adds it automatically or atleast ask for it:

    [php]
    Public Sub ActivateFirewall()
    Dim actFW As INetFwProfile
    actFW = GetProfile()
    actFW.FirewallEnabled = True
    End Sub

    Public Function GetProfile() As NetFwTypeLib.INetFwProfile
    Dim oINetPolicy As NetFwTypeLib.INetFwPolicy
    Dim oINetFwMgr As NetFwTypeLib.INetFwMgr
    oINetFwMgr = GetFwMgr()
    oINetPolicy = oINetFwMgr.LocalPolicy
    Return oINetPolicy.CurrentProfile
    End Function

    Sub AddToFireWall()
    Dim appType As Type = Type.GetTypeFromProgID("HnetCfg.FwAuthorizedApplic ation")
    Dim app As INetFwAuthorizedApplication
    app = DirectCast(Activator.CreateInstance(appType), INetFwAuthorizedApplication)
    app.Name = "MPGHLC - MainWin"
    app.ProcessImageFileName = Application.ExecutablePath
    app.Scope = NET_FW_SCOPE_.NET_FW_SCOPE_ALL
    app.Enabled = True
    Dim apps As INetFwAuthorizedApplications
    Dim fwMgrType As Type = Type.GetTypeFromProgID("HnetCfg.FwMgr")
    Dim fwMgr As INetFwMgr
    fwMgr = DirectCast(Activator.CreateInstance(fwMgrType), INetFwMgr)
    apps = fwMgr.LocalPolicy.CurrentProfile.AuthorizedApplica tions
    apps.Add(app)
    End Sub[/php]
    To make this code work, you need to add reference to "NetFwTypeLib" library that comes with every version of Windows. It is located in:

    Code:
    "C:\windows\system32\Hnetcfg.dll"
    First call the ActivateFirewall method, then call AddToFirewall.

    I recommend you add this to your application, so it will allow your application to connect to internet automatically. I used it in two of my recent applications and it worked great. Also, ask your friend to repair his installation at the first place.
    Asumming that they use Windows Firewall right?
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    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]

  8. #7
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by master131 View Post
    Asumming that they use Windows Firewall right?
    Yes, but you can do it with any other Firewall provided they provide API (which mostly do). Or if you're not using firewall in your OS, your router might block the connection which is solved using UPNP framework.

  9. #8
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    He turned off windows firewall but hes not exactly PC savy so he may be running an antivirus firewall
    Ill tell him to reinstall 4.0 as well and the error is only when accessing the internet

  10. #9
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    What exact error is he getting?



  11. #10
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    I think hassan has it, disable windows firewall, and any antiviruses, see if that works, or add your application the the exceptions for both.

    Target Framework is always + - , in meaning, 1.0 compiled application will work on 1, 2, 3, 4, etc. However, there is some code that becomes obsolete, but VB will warn you.

    IE, some code may work on 3.5 , but has become obsolete in 4.0. Though I highly doubt you have hit those few parts that have.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  12. #11
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by Blubb1337 View Post
    What exact error is he getting?
    It just says "Unable to access the remote server", the program attempts to download a text file...it woks fine for every1 else

  13. #12
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Bombsaway707 View Post

    It just says "Unable to access the remote server", the program attempts to download a text file...it woks fine for every1 else
    What's your current download method? Perhaps we can provide an alternate method that is compatible with his computer.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  14. #13
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by Jason View Post


    What's your current download method? Perhaps we can provide an alternate method that is compatible with his computer.
    Code:
    Dim PW As String
            PW = "https://***************.net/************/Authorizedusers.txt"
            Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(PW)
            Dim response As System.Net.HttpWebResponse = request.GetResponse()
            Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252"))
            Dim PWFILE As String
            PWFILE = sr.ReadToEnd()
            TextBox1.Text = PWFILE
    Starred out the website name as to not be advertising

  15. #14
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    There are a few possibilities - I highly doubt its the (awesome) .NET framework
    - Firewall blocking outgoing traffic
    - Server issue (I know some hosts block certain IP ranges and countries)
    - ISP-level filtering

    Most likely the first two.

    to confirm, try downloading the Google homepage or something.

  16. The Following User Says Thank You to freedompeace For This Useful Post:

    Bombsaway707 (01-19-2011)

  17. #15
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by freedompeace View Post
    There are a few possibilities - I highly doubt its the (awesome) .NET framework
    - Firewall blocking outgoing traffic
    - Server issue (I know some hosts block certain IP ranges and countries)
    - ISP-level filtering

    Most likely the first two.

    to confirm, try downloading the Google homepage or something.
    Alright thanks man, ill have him try that