📄 webservice1.pas.~12~
字号:
unit WebService1;
interface
uses
System.Collections, System.ComponentModel,
System.Data, System.Diagnostics, System.Web,
System.Web.Services;
type
/// <summary>
/// Summary description for WebService1.
/// </summary>
TWebService1 = class(System.Web.Services.WebService)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
components: IContainer;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(disposing: boolean); override;
private
{ Private Declarations }
public
constructor Create;
(*
// Sample Web Service Method
[WebMethod]
function HelloWorld: string;
*)
[WebMethod]
function Equation_x1(a,b,c:double): double;
function Equation_x2(a,b,c:double): double;
end;
implementation
{$REGION 'Designer Managed Code'}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWebService1.InitializeComponent;
begin
end;
{$ENDREGION}
constructor TWebService1.Create;
begin
inherited;
//
// Required for Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure TWebService1.Dispose(disposing: boolean);
begin
if disposing and (components <> nil) then
components.Dispose;
inherited Dispose(disposing);
end;
// Sample Web Service Method
// The following method is provided to allow for testing a new web service.
(*
function TWebService1.HelloWorld: string;
begin
Result := 'Hello World';
end;
*)
function TWebService1.Equation_x1(a,b,c:double): double;
var sqrtx:double;
begin
sqrtx := Math.Sqrt(b*b-4*a*c);
Result := (-b+sqrtx)/(2*a);
end;
function TWebService1.Equation_x2(a,b,c:double): double;
var sqrtx:double;
begin
sqrtx := Math.Sqrt(b*b-4*a*c);
Result := (-b-sqrtx)/(2*a);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -