📄 index.htm
字号:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>RAS component for Delphi</title>
<style fprolloverstyle>A:hover {color: #FF0000}
</style>
</head>
<body style="font-family: Arial" text="#000080" bgcolor="#C0C0C0" link="#400080" vlink="#004080" alink="#8000FF" background="/pic/bg.jpg" nosave leftmargin="15">
<h1 align="center"><a href="http://www.ryvkin.com/RasObject.zip">TRasObject</a></h1>
<h2 align="center">Implementation of Remote Access API as Delphi component</h2>
<p align="center">(C) Copyright 2001, <a href="mailto:to@ryvkin.com">Serge
Ryvkin</a></p>
<p> </p>
<ol>
<li><a href="#Ch1"><b>Realized possibilities</b></a></li>
<li><a href="#Ch2"><b>Purchasing</b></a></li>
<li><a href="#Ch3"><b>Installation</b></a></li>
<li><b><a href="#Ch4">Usage</a></b>
<ul>
<li><b><a href="#Properties">Properties</a></b></li>
</ul>
<blockquote>
<ul>
<li><b><a href="#PhoneBook">PhoneBook</a></b></li>
<li><b><a href="#ActiveNames">ActiveNames</a></b></li>
<li><b><a href="#RefreshInterval">RefreshInterval</a></b></li>
</ul>
</blockquote>
<ul>
<li><b><a href="#Fields">Fields</a></b></li>
</ul>
<blockquote>
<ul>
<li><b><a href="#ActiveConnections">ActiveConnections</a></b></li>
<li><b><a href="#Parameters">Parameters</a></b></li>
</ul>
</blockquote>
<ul>
<li><b><a href="#Methods">Methods</a></b></li>
</ul>
<blockquote>
<ul>
<li><b><a href="#Create">Create</a></b></li>
<li><b><a href="#Destroy">Destroy</a></b></li>
<li><b><a href="#CreateEntry">CreateEntry</a></b></li>
<li><b><a href="#EditEntry">EditEntry</a></b></li>
<li><b><a href="#RenameEntry">RenameEntry</a></b></li>
<li><b><a href="#DeleteEntry">DeleteEntry</a></b></li>
<li><b><a href="#GetParameters">GetParameters</a></b></li>
<li><b><a href="#SetParameters">SetParameters</a></b></li>
<li><b><a href="#Dial">Dial</a></b></li>
<li><b><a href="#Hangup1">HangUp (1)</a></b></li>
<li><b><a href="#Hangup2">HangUp (2)</a></b></li>
<li><b><a href="#Wait">Wait</a></b></li>
</ul>
</blockquote>
<ul>
<li><b><a href="#Events">Events</a></b></li>
</ul>
<blockquote>
<ul>
<li><b><a href="#OnStatusChange">OnStatusChange</a><br>
</b></li>
</ul>
</blockquote>
</li>
</ol>
<h3><a name="Ch1"></a>1. Realized possibilities</h3>
<p><b>TRasObject</b> component allows to developer to use remote access service
(usually, modem dialup) in simplest way. The developer can create, modify and
delete connections, dial selected connection and disconnect. The component is
realized on base of Microsoft Remote Access Service API, translated for Delphi
by <a href="mailto:dmoretti@iper.net">Davide Moretti</a>. It is checked on
Windows 95 (with additional MS DLL library <a href="http://www.microsoft.com/win32dev/apiext/rasapi.htm">RINAPH.DLL</a>),
Windows 95 OSR2, Windows 98, Windows 98 SR1, Windows ME, Windows 2000. Free
version of the component is compiled by Borland Delphi 5.0. </p>
<h3><a name="Ch2"></a>2. Purchasing</h3>
<p>You can use free of charge for commercial and non commercial purposes
compiled version of the component and source code of test application. If you
want to purchase component source code, you can do it through <a href="http://www.shareit.com">ShareIt!</a>
registration service pressing the following button.</p>
<p><a href="http://shareit1.element5.com/product.html?productid=143861&backlink=http://www.ryvkin.com/RasObject"><img border="0" src="shareitlogo.gif" width="170" height="52"></a></p>
<h3><a name="Ch3"></a>3. Installation</h3>
<p>Unpack received file <b><a href="http://www.ryvkin.com/RasObject.zip">RasObject.zip</a></b> to separate folder. From Delphi IDE
select <b>Component | Install Packages</b> and the button <b>Add</b>. In dialog
select <b>RasPack.bpl</b> file and press <b>Open</b> button. Package will be
installed, and the <b>TRasObject</b> component will appear on palette <b>Ryvkin</b>.</p>
<p>To compile properly the application with the component, <b>.dcu</b> files
must be in the same folder as <b>RasPack.bpl</b> file.</p>
<h3><a name="Ch4"></a>4. Usage</h3>
<p><b>TRasObject</b> is standard Delphi component. It can be placed on form or data
module, developer can adjust properties and set events and use its
possibilities. </p>
<p>Usually developer needs to realize simple task to allow his application to
access to the RAS - manage connection entries, dial and hang up. <b>TRasObject</b>
allows it! You can manage connections (create, modify, rename, delete), dial synchronously
of asynchronously and hang up. Through components properties you can
receive full and real time updated list of available and active connections, and
assign event to receive RAS status.</p>
<h3><a name="Properties"></a>Properties:</h3>
<p><i><b><a name="PhoneBook"></a>PhoneBook: TStringList</b></i></p>
<p>Developer can use <b><a href="#PhoneBook">PhoneBook</a></b> to access to full list of available
connections. The list is updating dynamically with refresh interval, selected by
<b><a href="#RefreshInterval">RefreshInterval</a></b> property. This list is read-only. Dynamic updates
available during runtime only.</p>
<p><i><b><a name="ActiveNames"></a>ActiveNames: TStringList</b></i></p>
<p>Developer can use ActiveNames during design time to access to full list of
names of active connections. The list is updating dynamically with refresh
interval, selected by <b><a href="#RefreshInterval">RefreshInterval</a></b> property. This list is read-only.
Dynamic updates available during runtime only. During runtime it would be more convenient
to use <b><a href="#ActiveConnections">ActiveConnections</a></b> field.</p>
<p><i><b><a name="RefreshInterval"></a>RefreshInterval: integer</b></i></p>
<h3><a name="Fields"></a>Fields:</h3>
<p><i><b><a name="ActiveConnections"></a>ActiveConnections: array of TRasObjectActiveConnection</b></i></p>
<dl>
<dd>
<pre><b>type</b> TRasObjectActiveConnection = <b>record</b>
Handle: Pointer; // Connection handle
Name: <b>string</b>; // Name in phonebook
DeviceType: <b>string</b>; // Used device type
DeviceName: <b>string</b>; // Used device name
Status: <b>string</b>; // Status string
<b>end;</b></pre>
</dd>
<dt>Developer can use <b><a href="#ActiveConnections"> ActiveConnections</a></b> to receive real-time status of all
active connections. The list is updating dynamically with refresh interval,
selected by <b><a href="#RefreshInterval">RefreshInterval</a></b> property. This list is read-only. Dynamic
updates available during runtime only.</dt>
</dl>
<p><i><b><a name="Parameters"></a>Parameters: TRasObjectParameters</b></i></p>
<blockquote>
<pre><b>type</b> TRasObjectParameters = <b>class</b>
.......</pre>
<pre><b>public</b>
Domain: <b>string</b>; // MS Domain name
Username: <b>string</b>; // User name
Password: <b>string</b>; // Password
PhoneNumber: <b>string</b>; // Phone number
CallbackNumber: <b>string</b>; // Callback number
<b>procedure</b> Clear; // Clear parameters
<b>function</b> IsEmpty: <b>boolean</b>; // Check, if all parameterss are empty
end;
</pre>
</blockquote>
<p>Developer can use this field to store and retrieve RAS call parameters from
phonebook entry using methods .</p>
<h3><a name="Methods"></a>Methods:</h3>
<p><b><i><a name="Create"></a>constructor Create(aOwner: TComponent);</i></b></p>
<ul>
<li>Create the component and set default values</li>
</ul>
<p><b><i><a name="Destroy"></a>destructor Destroy;</i></b></p>
<ul>
<li>Destroy component and free memory</li>
</ul>
<p><b><i><a name="CreateEntry"></a>function CreateEntry: boolean;</i></b></p>
<ul>
<li>Create phonebook entry. Starts RAS default wizard that will create new
connection.</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<p><b><i><a name="EditEntry"></a>function </i></b><b><i>EditEntry(const EntryName: string)</i></b><b><i>:
boolean;</i></b></p>
<ul>
<li>Edit phonebook entry. Starts RAS default dialog that will enable to edit
connection.</li>
<li><b>EntryName</b> - Name of phonebook entry</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<p><b><i><a name="RenameEntry"></a>function RenameEntry(const EntryName: string; const NewEntryName:
string): boolean;</i></b></p>
<ul>
<li>Rename phonebook entry. Asks user to enter new name and renames connection</li>
<li><b>EntryName</b> - Name of phonebook entry</li>
<li><b>NewEntryName</b> - New name of phonebook entry</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<p><b><i><a name="DeleteEntry"></a>function </i></b><b><i>DeleteEntry(const EntryName: string)</i></b><b><i>:
boolean;</i></b></p>
<ul>
<li>Delete phonebook entry. </li>
<li><b>EntryName</b> - Name of phonebook entry</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<h4><b><i><a name="GetParameters"></a>function </i></b><i> GetParameters(const EntryName: string): boolean;</i></h4>
<ul>
<li>Retrieve stored in connection parameters into <b><a href="#Parameters">Parameters</a></b> field</li>
<li><b>EntryName</b> - Name of phonebook entry</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<h4><b><i><a name="SetParameters"></a>function </i></b><i> SetParameters(const EntryName: string): boolean; </i></h4>
<ul>
<li>Save stored in <b><a href="#Parameters">Parameters</a></b> field data to phonebook entry</li>
<li><b>EntryName</b> - Name of phonebook entry</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<h4><b><i><a name="Dial"></a>function </i></b><i> Dial(const EntryName: string; DialMode:
TRasObjectMode): boolean; </i></h4>
<ul>
<li>Dial using selected phonebook entry. If <b><a href="#Parameters">Parameters</a></b> field is not
empty, connection parameters will be retrieved from it, otherwise - from
phonebook entry.</li>
<li><b>DialMode</b> - <b>rasSync</b> or <b>rasAsync</b></li>
<li><b>EntryName</b> - Name of phonebook entry</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<h4><b><i><a name="Hangup1"></a>function </i></b><i>HangUp(Connection: TRasObjectActiveConnection):
boolean; overload; </i></h4>
<ul>
<li>Hang up connection on base of <b><a href="#ActiveConnections">ActiveConnections</a></b> value </li>
<li><b>Connection</b> - <b><a href="#ActiveConnections">ActiveConnection</a></b> property array member</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<h4><b><i><a name="Hangup2"></a>function </i></b><i> HangUp(const EntryName: string): boolean; overload; </i></h4>
<ul>
<li>Hang up connection on base of phonebook entry name </li>
<li><b>EntryName</b> - Name of phonebook entry</li>
<li><b>Returns</b>: True - OK, False - Error </li>
</ul>
<h4><i><a name="Wait"></a>procedure Wait(Time: DWORD); </i></h4>
<ul>
<li>Stop execution for <b>Time</b> milliseconds without increase of CPU usage.
Allows all processes (including GUI) perform their tasks.</li>
<li><b>Time</b> - time to wait</li>
</ul>
<h3><a name="Events"></a>Events:</h3>
<p><b><i><a name="OnStatusChange"></a>OnStatusChange: procedure(Sender: TObject; IsError: boolean;
StatusString: string)</i></b></p>
<ul>
<li>Event to access to RAS status</li>
<li><b>IsError</b> - if <b>StatusString</b> message is an error message</li>
<li><b>StatusString</b> - text representation of message</li>
</ul>
<p> </p>
<p>Serge Ryvkin<br>
<a href="mailto:to@ryvkin.com">to@ryvkin.com</a></p>
<p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -