Results 1 to 8 of 8

Thread: need to convert c# CONSOLE app to Windows form(c#)

  1. #1
    shabbir husain's Avatar
    shabbir husain is offline Senior Member+
    Last Online
    18th May 2016 @ 06:21 PM
    Join Date
    30 Nov 2010
    Location
    india
    Age
    30
    Gender
    Male
    Posts
    427
    Threads
    8
    Credits
    1,001
    Thanked
    8

    Question need to convert c# CONSOLE app to Windows form(c#)

    AssalamuAalikum...
    mujhe zel k C# "console" program ko "windows form" me tabdil krna hai,
    program ka task same ek hi ho'
    srif iska GUI change h,
    console app k Console.WriteLine(""); k text ko windows form me kahin b display kr den,
    chahe label
    ya
    list box me
    ya
    messg box me..

    to program ye hai:
    using System;
    using Eneter.Messaging.EndPoints.TypedMessages;
    using Eneter.Messaging.MessagingSystems.MessagingSystemB ase;
    using Eneter.Messaging.MessagingSystems.TcpMessagingSyst em;

    namespace ServiceExample
    {
    public class MyRequest
    {
    public string Text { get; set; }
    }
    public class MyResponse
    {
    public int Length { get; set; }
    }

    class Program
    {
    private static IDuplexTypedMessageReceiver<MyResponse, MyRequest> myReceiver;

    static void Main(string[] args)
    {
    IDuplexTypedMessagesFactory aReceiverFactory = new DuplexTypedMessagesFactory();
    myReceiver = aReceiverFactory.CreateDuplexTypedMessageReceiver< MyResponse, MyRequest>();

    myReceiver.MessageReceived += OnMessageReceived;
    IMessagingSystemFactory aMessaging = new TcpMessagingSystemFactory();
    IDuplexInputChannel anInputChannel =
    aMessaging.CreateDuplexInputChannel("tcp://127.0.0.1:8060/");
    myReceiver.AttachDuplexInputChannel(anInputChannel );

    Console.WriteLine("The service is running. To stop press enter.");
    Console.ReadLine();
    myReceiver.DetachDuplexInputChannel();
    }
    private static void OnMessageReceived(object sender,
    TypedRequestReceivedEventArgs<MyRequest> e)
    {
    Console.WriteLine("Received: " + e.RequestMessage.Text);
    MyResponse aResponse = new MyResponse();
    aResponse.Length = e.RequestMessage.Text.Length;
    myReceiver.SendResponseMessage(e.ResponseReceiverI d, aResponse);
    }
    }
    }

  2. #2
    shabbir husain's Avatar
    shabbir husain is offline Senior Member+
    Last Online
    18th May 2016 @ 06:21 PM
    Join Date
    30 Nov 2010
    Location
    india
    Age
    30
    Gender
    Male
    Posts
    427
    Threads
    8
    Credits
    1,001
    Thanked
    8

  3. #3
    usama khalil's Avatar
    usama khalil is offline Advance Member
    Last Online
    20th August 2019 @ 09:47 AM
    Join Date
    30 Jan 2010
    Location
    islamabad
    Age
    31
    Gender
    Male
    Posts
    985
    Threads
    51
    Credits
    1,174
    Thanked
    76

    Default

    brother form banao variable declare karo textbox do phr ki coding ki bat karein gay

  4. #4
    shabbir husain's Avatar
    shabbir husain is offline Senior Member+
    Last Online
    18th May 2016 @ 06:21 PM
    Join Date
    30 Nov 2010
    Location
    india
    Age
    30
    Gender
    Male
    Posts
    427
    Threads
    8
    Credits
    1,001
    Thanked
    8

    Default

    Quote usama khalil said: View Post
    brother form banao variable declare karo textbox do phr ki coding ki bat karein gay


    han bhai maine form me gui bana diya hai...aur jaisa maine kiya hai usse kam nahi chalraha
    help

  5. #5
    The Genius's Avatar
    The Genius is offline Advance Member
    Last Online
    4th November 2023 @ 12:27 AM
    Join Date
    21 Feb 2011
    Gender
    Male
    Posts
    977
    Threads
    16
    Credits
    668
    Thanked
    85

    Default

    Quote shabbir husain said: View Post
    han bhai maine form me gui bana diya hai...aur jaisa maine kiya hai usse kam nahi chalraha
    help
    Project attach kro main dekhta hoon kia problem he.

  6. #6
    shabbir husain's Avatar
    shabbir husain is offline Senior Member+
    Last Online
    18th May 2016 @ 06:21 PM
    Join Date
    30 Nov 2010
    Location
    india
    Age
    30
    Gender
    Male
    Posts
    427
    Threads
    8
    Credits
    1,001
    Thanked
    8

    Default

    han bhai krta hun wait...filhal my mobile se online hun

  7. #7
    shabbir husain's Avatar
    shabbir husain is offline Senior Member+
    Last Online
    18th May 2016 @ 06:21 PM
    Join Date
    30 Nov 2010
    Location
    india
    Age
    30
    Gender
    Male
    Posts
    427
    Threads
    8
    Credits
    1,001
    Thanked
    8

    Default

    yahan file attach nahi horahi :/

  8. #8
    shabbir husain's Avatar
    shabbir husain is offline Senior Member+
    Last Online
    18th May 2016 @ 06:21 PM
    Join Date
    30 Nov 2010
    Location
    india
    Age
    30
    Gender
    Male
    Posts
    427
    Threads
    8
    Credits
    1,001
    Thanked
    8

    Default

    bhai screenshot dijiye yahn file kaise attach karun?

Similar Threads

  1. Keyboard Shortcuts (Microsoft Windows)
    By Abdul_sami12 in forum English IT Zone
    Replies: 9
    Last Post: 1st June 2014, 03:52 PM
  2. 100 keyboard shortcuts
    By uxpos in forum English IT Zone
    Replies: 40
    Last Post: 10th July 2013, 01:14 PM
  3. Window Short Cuts
    By cute_charming786 in forum General Discussion
    Replies: 18
    Last Post: 10th December 2011, 11:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •