DartStream Object : ReadString Method |
Visual Basic |
---|
Public Function ReadString( _ Optional ByVal Count As Long = 0 _ ) As String |
Some environments, such as JavaScript, do not support the passing of parameters by reference. Consequently, such methods as Receive cannot be used by passing in a String. You can use the DartStream Object to circumvent this limitation, as shown in the following Java sample:
<% @LANGUAGE="JScript"%>
<%
var Tcp = Server.CreateObject("Dart.Tcp.1");
Tcp.TimeOut = 30000;
Tcp.Connect("www.microsoft.com", 80);
Tcp.Send("GET / HTTP/1.0\r\n\r\n");
var Stream = Server.CreateObject("Dart.DartStream");
while(Tcp.State != 0)
Tcp.Receive(Stream);
Stream.Position = 0;
Response.Write(Stream.ReadString());
%>
This method may generate the following error code (refer to ErrorConstants for a complete list of error codes):