Conversion from Visual Basic Express to C#

Posted on 2012-08-27
Last Modified: 2012-08-28
Hi, I am trying to convert Visual Basic Express File to C# for further development. Few things couldn't figure out. Please do assist on the matter.

Imports System.Net.Sockets
using System.NetSockets
Imports FServerSupport.PLCNetwork
//I did attached the FServerSupport.dll in reference and trying out using FServerSupport //and press dot, the PLCNetwork doesn't appear.

Public Function ConnectToServer(ByRef stream As [NetworkStream], _
                                  ByVal usr As [String], ByVal pw As [String]) As String

//is this correct
Public string ConnectToServer( NetworkStream stream, string usr, string pw)
// just doubted on string whether string or String.
Question by:TITO2009
    1 Comment
    LVL 20

    Accepted Solution

    Well you can use this

    String and string are both fine in C#.

    Is it a typo

    or u hav been using

    using System.NetSockets

    It should be
    using System.NetSockets;

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    731 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

    15 Experts available now in Live!

    Get 1:1 Help Now