Click here to Skip to main content
15,922,166 members
Home / Discussions / C#
   

C#

 
QuestionNeed code for the following Pin
Member 1140900728-Jan-15 3:46
Member 1140900728-Jan-15 3:46 
AnswerRe: Need code for the following Pin
Richard MacCutchan28-Jan-15 4:21
mveRichard MacCutchan28-Jan-15 4:21 
Question.NET Reporting Mechanism Pin
Jassim Rahma28-Jan-15 2:18
Jassim Rahma28-Jan-15 2:18 
AnswerRe: .NET Reporting Mechanism Pin
Eddy Vluggen28-Jan-15 7:19
professionalEddy Vluggen28-Jan-15 7:19 
QuestionInsert data from feed to sql table Pin
Alexmarvel28-Jan-15 0:25
Alexmarvel28-Jan-15 0:25 
AnswerRe: Insert data from feed to sql table Pin
OriginalGriff28-Jan-15 0:38
mveOriginalGriff28-Jan-15 0:38 
AnswerRe: Insert data from feed to sql table Pin
ZurdoDev28-Jan-15 3:45
professionalZurdoDev28-Jan-15 3:45 
QuestionHelp in converting this C# console into C# winform Pin
Member 1032105927-Jan-15 22:01
Member 1032105927-Jan-15 22:01 
Hi, I started converting the program last night up to 2AM (5PM here as of writing this).
I feel like I'm consuming much time in thinking and Trial and Error, I really need some help.
I bet this is easy for those who has experience in C#.

Take a look at this sample project (this project is a C# console, socket programming (telnet) ).
http://www.codeproject.com/Articles/19071/Quick-tool-A-minimalistic-Telnet-library

and then, what I need to do are the following:

1. Remove the user and password submission, since I'm going to telnet my microcontroller and
that microcontroller doesn't have such security. In the sample program above, if the ip
you are going to telnet doesn't have user and password requirement, it will return an exception.
(Actually, I have already done this, I modified the C# console sample
program, and magically it works. look at my code below)

C#
static void Main(string[] args)
       {
           //create a new telnet connection to hostname "gobelijn" on port "23"
           TelnetConnection tc = new TelnetConnection("news.thundernews.com", 23);

          // IN THIS PART, I REMOVED THE LOGIN FUNCTION USE.

           String prompt = "";

           // while connected
           while (tc.IsConnected && prompt.Trim() != "exit" )
           {
               // display server output
               Console.Write(tc.Read());



2. In my windows form, I have there BUTTON1, and whenever you click that, it will CONNECT the program to the
desired ip address via TELNET. My problem is, I will consume much much time in thinking of this. I don't even
know yet how does my edited code posted above work.


3. I have too a BUTTON2, if you click this, the C# program will send a string from any controls, like textbox.
(I think, no need for this to answer. tc.WriteLine(prompt); <-- that code will send byte to the server)

4. finally, as soon as the BUTTON1 connect is clicked, the C# program will auto receive any incoming byte from the server,
and the program will put the received bytes into some controls, say.... RICH TEXT BOX.

I have tried my best to convert this C# program (which works 100%, but I really need a winform sample) to winform.
I just need a very example and I will take care of the rest of my project.
One of the things that make me go crazy is where should I put the WHILE LOOP part from C# console to C# winform?


That's all. Thank you so much in advance!

G
AnswerRe: Help in converting this C# console into C# winform Pin
OriginalGriff27-Jan-15 22:46
mveOriginalGriff27-Jan-15 22:46 
QuestionAdding arraylist elements but some must be -1 Pin
Mac20nine26-Jan-15 13:54
Mac20nine26-Jan-15 13:54 
AnswerRe: Adding arraylist elements but some must be -1 Pin
Pete O'Hanlon26-Jan-15 20:12
mvePete O'Hanlon26-Jan-15 20:12 
AnswerRe: Adding arraylist elements but some must be -1 Pin
OriginalGriff26-Jan-15 20:14
mveOriginalGriff26-Jan-15 20:14 
AnswerRe: Adding arraylist elements but some must be -1 Pin
V.27-Jan-15 0:16
professionalV.27-Jan-15 0:16 
QuestionDo you prefer using Microsoft Enterprise Data Block over EF 6.0 Pin
shiv Mohan26-Jan-15 9:33
shiv Mohan26-Jan-15 9:33 
AnswerRe: Do you prefer using Microsoft Enterprise Data Block over EF 6.0 Pin
ZurdoDev26-Jan-15 10:10
professionalZurdoDev26-Jan-15 10:10 
GeneralRe: Do you prefer using Microsoft Enterprise Data Block over EF 6.0 Pin
John C Rayan26-Jan-15 10:33
professionalJohn C Rayan26-Jan-15 10:33 
AnswerRe: Do you prefer using Microsoft Enterprise Data Block over EF 6.0 Pin
Mycroft Holmes26-Jan-15 11:45
professionalMycroft Holmes26-Jan-15 11:45 
AnswerRe: Do you prefer using Microsoft Enterprise Data Block over EF 6.0 Pin
Eddy Vluggen27-Jan-15 7:26
professionalEddy Vluggen27-Jan-15 7:26 
GeneralRe: Do you prefer using Microsoft Enterprise Data Block over EF 6.0 Pin
Mycroft Holmes27-Jan-15 13:41
professionalMycroft Holmes27-Jan-15 13:41 
QuestionThe form appeared in debug mode even though I deleted it. Pin
WrightSfiso25-Jan-15 22:36
WrightSfiso25-Jan-15 22:36 
AnswerRe: The form appeared in debug mode even though I deleted it. Pin
OriginalGriff25-Jan-15 22:45
mveOriginalGriff25-Jan-15 22:45 
GeneralRe: The form appeared in debug mode even though I deleted it. Pin
WrightSfiso25-Jan-15 22:49
WrightSfiso25-Jan-15 22:49 
GeneralRe: The form appeared in debug mode even though I deleted it. Pin
OriginalGriff25-Jan-15 22:57
mveOriginalGriff25-Jan-15 22:57 
GeneralRe: The form appeared in debug mode even though I deleted it. Pin
WrightSfiso26-Jan-15 2:34
WrightSfiso26-Jan-15 2:34 
GeneralRe: The form appeared in debug mode even though I deleted it. Pin
OriginalGriff26-Jan-15 3:55
mveOriginalGriff26-Jan-15 3:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.