Login  
Search All Forums
Dart Home | PowerTCP Emulation for .NET | Custom Development Reply | PowerTCP Emulation for .NET Topics | Forums   
AuthorForum: PowerTCP Emulation for .NET
Topic: power tcp emulation for .net
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 14, 2005 12:45 PM

Once I downloaded the latest dll, I started getting the following error and do not know what is causing
The value of argument 'code' (152) is invalid for Enum type 'Option Code'. Parameter name: code

I get this error with your sample program
C:\Program Files\PowerTCP\Emulation for .NET\Samples\VB\Telnet Client (External)\

and with my project.

Please advise
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 15, 2005 9:48 AM

Check the references in your references list to make sure the Telnet and Vt are in the same location. At the time of this post the Telnet DLL is version 1.0.3.0 and Vt is 1.0.2.0.

If they are correct and you are still getting the error, please let me know exactly what I have to do to see it.
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 15, 2005 11:53 AM

The versions are correct. I am running vs2005 final. What do you mean, "please let me know exactly what I have to do to see it". I could zip project and email to you. I am using your sample as described in my original post.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 15, 2005 12:33 PM

I have run all the samples before with no problem. I need to know exactly which sample to open and exactly what to do with it. Also, are you using VS2003 or 2005?

bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 15, 2005 2:15 PM

I am running your sample program
C:\Program Files\PowerTCP\Emulation for .NET\Samples\VB\Telnet Client (External)\

with vs2005
I have not made any changes to your sample program. When I run file,connect and fill out dialog for connection information and click on OK this is where I get the error.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 15, 2005 2:23 PM

Do you have Visual Studio 2003? Or just 2005? I think you are running into a problem we are currently looking at: The VT does not instantiate in VS2005 unless VS2003 is installed.

bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 15, 2005 2:25 PM

just 2005
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 15, 2005 2:27 PM

Then unfortunately you are out of luck until I can figure out what needs to be done to get the control to work in VS2005 without 2003. As soon as I find something out, I'll post here.

bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 15, 2005 2:33 PM

Looking forward to posting, Thanks
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 15, 2005 2:54 PM

Ok, I think I found it. The Emulation DLL is actually built using VC7 and is dependent on msvcr71.dll. It appears we need to distribute this file in our setup.

Can you check whether you have that file on your system? It should be in c:\windows\system32. If you don't have it, download this one:

http://support.dart.com/downloads/msvcr71.zip

and put it in the system32 directory, then try to open the sample again.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 15, 2005 5:30 PM

You can also get the DLL from the System32\URTTemp directory. I have verified that on clean install of Windows XP, VS2005 and Emulation for .NET I am able to get it to work simply by copying:

C:\WINDOWS\SYSTEM32\URTTemp\MSVCR71.DLL

to

C:\WINDOWS\SYSTEM32\MSVCR71.DLL



bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 15, 2005 11:02 PM

C:\WINDOWS\SYSTEM32\MSVCR71.DLL
This DLL already exists on my xp sp2 system
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 16, 2005 9:40 AM

Does it happen with every server you connect to?
Do you have the debugging window open?
Anything you can tell me that would help me duplicate this would be great.
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 16, 2005 8:06 PM

Yes I have tried on two different servers and get same dialog message.

It happens in vs design and when I run exe

Here is routine it occurs at:

Private Sub DoLogin(ByVal host As String, ByVal username As String, ByVal password As String, ByVal prompt As String)
    'Try automatic login. If fails, just connect
    telnet1.AutoReceive = False
    telnet1.ReceiveTimeout = 5000
    Dim data As String
    Try
      data = telnet1.Login(host, username, password, prompt).ToString()
      If (Not data.EndsWith(prompt)) Then
        vt1.Write(vbCrLf + "The automated login attempt failed. Re-connecting ..." + vbCrLf)
        telnet1.Close()
        DoConnect(host, 23)
        Return
      End If
    Catch ex As Exception
      ShowError(ex.Message)
      Return
    End Try
    vt1.Write(data)
  End Sub


And Here is full text of exception:

The value of argument 'code' (152) is invalid for Enum type 'OptionCode'.
Parameter name: code
A first chance exception of type 'System.ComponentModel.InvalidEnumArgumentException' occurred in Dart.PowerTCP.Telnet.dll
System.ComponentModel.InvalidEnumArgumentException: The value of argument 'code' (152) is invalid for Enum type 'OptionCode'.
Parameter name: code
  at c.a(String A_0, Enum A_1)
  at Dart.PowerTCP.Telnet.TelnetStream.SendOption(Command command, OptionCode code)
  at Dart.PowerTCP.Telnet.TelnetStream.a(Byte[] A_0, Int32 A_1, Int32 A_2)
  at Dart.PowerTCP.Telnet.TelnetStream.Read(Byte[] buffer, Int32 offset, Int32 count)
  at Dart.PowerTCP.Telnet.SegmentedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
  at Dart.PowerTCP.Telnet.SegmentedStream.Read(Byte[] buffer, ArrayList delimiters, Int32 offset, Int32 count, Boolean& found)
  at Dart.PowerTCP.Telnet.SegmentedStream.Read(String delimiter, Int32 maxLength, Boolean& found)
  at Dart.PowerTCP.Telnet.Telnet.WaitFor(String prompt)
  at Dart.PowerTCP.Telnet.Telnet.Login(String server, String username, String password, String commandPrompt)
  at VT_Emulation_Client.frmMain.DoLogin(String host, String username, String password, String prompt) in C:\Program Files\PowerTCP\Emulation for .NET\Samples\VB\Telnet Client (External)\Main.vb:line 349
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 16, 2005 8:57 PM

Please put the following code in your trace event, then run the sample until it fails. Then zip up the trace log and send it to support@dart.com referencing this topic:


  Dim s As String
  ' If this us the result of an outgoing transmission, prepend the
  ' text with a right pointing arrow, otherwise use a left pointing
  ' arrow
    If e.Segment.Sent Then
      s += vbCrLf + "---> "
    Else
      s += vbCrLf + "<--- "
    End If
    s += e.Segment.ToString
  Dim Retry As Long
    Retry = 10
    Do While Retry > 0
      Try
  Dim Stream As New IO.FileStream("c:\DartVt-trace.log", IO.FileMode.OpenOrCreate, IO.FileAccess.ReadWrite)
        Stream.Seek(0, IO.SeekOrigin.End)
        Stream.Write(System.Text.Encoding.Default.GetBytes(s.ToCharArray), 0, System.Text.ASCIIEncoding.ASCII.GetByteCount(s.ToCharArray))
        Stream.Close()
        Retry = 0
      Catch ex As Exception
        Retry -= 1
        If Retry = 0 Then MsgBox(ex.Message, MsgBoxStyle.Critical, "Logfile Error")
      End Try
  Loop
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 16, 2005 10:00 PM

Put that code in:
 Private Sub telnet1_Trace(ByVal sender As Object, ByVal e As Dart.PowerTCP.Telnet.SegmentEventArgs) Handles telnet1.Trace

No log file generated and it never fired that event.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 16, 2005 10:24 PM

Do you have other servers you can try it on?
Can you I get access to your server?
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 16, 2005 10:30 PM

I tried it on my pc and another server with the same results. My server is my pc and all my other telnet clients work. Why does the trace event not fire?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 16, 2005 10:44 PM

If the trace event does not fire, then it means that no data was sent or received. If you can't get me access to your server, see if you can find public server that does the same thing.

bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted November 17, 2005 12:02 AM

I tested on this server with the same result.

Ok I have one that you can use to test.
[Private info removed]
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 17, 2005 10:33 AM

Thanks. I have duplicated this. I am going to try and get this fixed pretty quick, then I will email you a new version.

jimh

From: Waterloo, Australia
Posts: 1
Member Since: 03/05/06
posted March 5, 2006 3:14 PM

I to am attempting to evaluate your PowerTCP Emulation, but having the same problem (152), this occurs when attempting to contact an IBM Universe Telnet server on a windows system (2003 and XP), but its ok on a unix system.
I have both VS2003 and 2005 installed on my machine.
I don't normally have regular access to unix systems, so evaluating this product not easily possible.
Can you also keep me informed when you have a solution.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 7, 2006 11:17 AM

I'll send you the update that I sent to bobm so that you can try it. If you don't get the email in an hour or so, let me know.
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted September 13, 2020 3:31 PM

Using PowerTcp is there any way of capturing the username and password that i user enters when logging in.
would like to use these credentials to spawn off
some .net routines
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 448
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted September 16, 2020 3:16 PM

Thank you for your post.
Yes, you can either capture keys from the Vt.KeyDown event (and parse out the details needed), or you can implement a UI where the user enters their details in specific textbox (or otherwise) fields and use that information via the Telnet.Login() method to log into the server (and then utilize the information elsewhere as needed).

All the best,
Jamie
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted September 16, 2020 9:38 PM

Jamie i think i would like to capture key down event
are there any code examples as to how this could be accomplished.
Have no idea how to determine which keys to keep.
looking for how to determine where to start and end
capturing keys
ie
login:
Password:
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 448
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted September 17, 2020 11:05 AM

Unfortunately we do not have an example to provide. If you are interested in purchase of a custom sample, please email me at jamie.powell@dart.com for more information.

Regards,
Jamie
Reply | PowerTCP Emulation for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX