Integrating and c#

Posted on 2004-11-19
Last Modified: 2012-06-21
i have this methods in and i want to access them from c#
i am posting both of them...
can any one help me out


Imports System.Management
Public Function GetSignalStrength() As String
        On Error GoTo oops

        Dim query As ManagementObjectSearcher
        Dim Qc As ManagementObjectCollection
        Dim Oq As ObjectQuery
        Dim Ms As ManagementScope
        Dim Co As ConnectionOptions
        Dim Mo As ManagementObject
        Dim outp As String
        Dim ssid As String
        Co = New ConnectionOptions
        Ms = New ManagementScope("root\wmi")
        Oq = New ObjectQuery("SELECT * FROM MSNdis_80211_ReceivedSignalStrength Where active=true")
        query = New ManagementObjectSearcher(Ms, Oq)
        Qc = query.Get
        outp = ""
        For Each Mo In query.Get
            outp = outp & Mo("Ndis80211ReceivedSignalStrength") & " "
        Return Trim(outp)
        Exit Function
        Return Err.Description
    End Function

[[[[c# code]]]]--------------------------------------------------------------------------------------------------------
using System;
using System.Net;
using System.Net.Sockets;

namespace UdpEchoServer
    class App
        private const int ServerPortNumber = 9696;

        static void Main(string[] args)
            try {
                Socket udpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

                        EndPoint localEP = new IPEndPoint(IPAddress.Any, ServerPortNumber);
                EndPoint remoteEP = new IPEndPoint(IPAddress.None, ServerPortNumber);

                byte [] receiveBuffer = new byte [512];
                    while (true)
                        int receivedSize = udpSocket.ReceiveFrom(receiveBuffer, ref remoteEP);
                                                                                                             ***********//// i want to access the wireless signal strength method here
                        udpSocket.SendTo(receiveBuffer, receivedSize, SocketFlags.None, remoteEP);
                        catch (SocketException se)
Question by:prashanth_gurijala
    LVL 5

    Assisted Solution

    Create two projects in ONE solution.
    Project 1 = VB.NET
    Project 2 = C#

    Then simply call in either direction. VB.NET and C# are totally compatible, just not in the same project. Two projects, ONE solution.
    LVL 7

    Accepted Solution

    If you compile your VB.Net code into a dll and include the dll as a reference in your C# code and use the name space that your vb code is in then you would simply instantiate the class that the function is in and execute the function on that class...

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now