Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Ϊʲô ûÓÐΪÀàAuthClassÕÒµ½ÓÐЧµÄ¹¹Ô캯Êý

2 posts in iAnywhere General Discussion (Chinese) Last posting was on 2009-01-07 00:19:16.0Z
liyp Posted on 2008-12-24 06:23:31.0Z
Reply-To: "liyp" <yp_li@sina.com>
From: "liyp" <yp_li@sina.com>
Newsgroups: ianywhere.public.chinese.general
Subject: Ϊʲô ûÓÐΪÀàAuthClassÕÒµ½ÓÐЧµÄ¹¹Ô캯Êý
Lines: 74
Organization: nr
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4951d563@forums-1-dub>
Date: 23 Dec 2008 22:23:31 -0800
X-Trace: forums-1-dub 1230099811 10.22.241.152 (23 Dec 2008 22:23:31 -0800)
X-Original-Trace: 23 Dec 2008 22:23:31 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.chinese.general:890
Article PK: 587

ÎÒÄ¿Ç°ÔÚÊÔÓÿª·¢°æ£¬¿ÉÊÇ°´ÕÕ°ïÖúÊÖ²áÉϵÄÒªÇóдϽű¾Ê±³öÏÖÎÊÌâ¡£

Ê×ÏÈÎҵĽű¾ÔÚ¹¹Ô캯ÊýÕâ¶ÎÊÇ£º

using System;
using iAnywhere.MobiLink.Script;
namespace MLink{

public class AuthClass {
private DBConnection _conn;

/// AuthClass constructor.

public AuthClass( DBConnectionContext cc ) {
_conn = cc.GetConnection();
}

/// The DoAuthenticate method handles the 'authenticate_user'
/// event.
/// Note: This method does not handle password changes for
/// advanced authorization status codes.

public void DoAuthenticate(
ref int authStatus,
string user,
string pwd,
string newPwd ) {
DBCommand pwd_command = _conn.CreateCommand();
pwd_command.CommandText = "select pwd from user_pwd_table"
+ " where user_name = ? ";
pwd_command.Prepare();
// add a parameter for the user name
DBParameter user_param = new DBParameter();
user_param.DbType = SQLType.SQL_CHAR;
// Set the size for SQL_VARCHAR.
user_param.Size = (uint)user.Length;
user_param.Value = user;
pwd_command.Parameters.Add( user_param );
// Fetch the password for this user.
DBRowReader rr = pwd_command.ExecuteReader();
object[] pwd_row = rr.NextRow();
if( pwd_row == null ) {
// User is unknown.
authStatus = 4000;
} else {
if( ((string)pwd_row[0]) == pwd ) {
// Password matched.
authStatus = 1000;
} else {
// Password did not match.
authStatus = 4000;
}
}
pwd_command.Close();
rr.Close();
return;
}
}
}


Ö´Ðйý³ÌÖУ¬mobilink·þÎñÆ÷Ìáʾ³öÏÖ´íÎó
ûÓÐΪÀàAuthClassÕÒµ½ÓÐЧµÄ¹¹Ô캯Êý¡£

Ìí¼Ó´úÂ룺
public AuthClass() {}
ºó£¬ Ö´ÐÐDoAuthenticate ʱ£¬Ìáʾ´íÎ󣬸ú×Ù·¢ÏÖ£¬DBCommand pwd_command =
_conn.CreateCommand();
³ö´í¡£

Çë½ÌÄÄÀï³ö´íÁË


Raymond Kwong Posted on 2009-01-07 00:19:16.0Z
From: "Raymond Kwong" <rkwong_nospam@ianywhere.com>
Newsgroups: ianywhere.public.chinese.general
References: <4951d563@forums-1-dub>
Subject: Re: Ϊʲô ûÓÐΪÀàAuthClassÕÒµ½ÓÐЧµÄ¹¹Ô캯Êý
Lines: 81
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4963f504$1@forums-1-dub>
Date: 6 Jan 2009 16:19:16 -0800
X-Trace: forums-1-dub 1231287556 10.22.241.152 (6 Jan 2009 16:19:16 -0800)
X-Original-Trace: 6 Jan 2009 16:19:16 -0800, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.chinese.general:894
Article PK: 586

Ö÷Òª¿ÉÄÜÊÇÄã°Ñianywhere.mobilink.* µÄAssemblyºÍÄãÄãдµÄ.dll´æì¶Í¬Ò»ÙYÁϊAÄÚ¡£ÔÚVisual StudioÀï"Copy Locale" = trueµÄȱʡÉèÖÃʹBuild filesºÍ
ianywhere.mobilink.script.*µÄµµ·ÅÔÚͬһ×ÊÁϼУ¬Ôڴ˽¨ÒéÄã°ÑËüÃÇ·ÅÔÚ²»Í¬µÄ¼ÐÄÚ¡£

"liyp" <yp_li@sina.com> wrote in message news:4951d563@forums-1-dub...
> ÎÒÄ¿Ç°ÔÚÊÔÓÿª·¢°æ£¬¿ÉÊÇ°´ÕÕ°ïÖúÊÖ²áÉϵÄÒªÇóдϽű¾Ê±³öÏÖÎÊÌâ¡£
>
> Ê×ÏÈÎҵĽű¾ÔÚ¹¹Ô캯ÊýÕâ¶ÎÊÇ£º
>
> using System;
> using iAnywhere.MobiLink.Script;
> namespace MLink{
>
> public class AuthClass {
> private DBConnection _conn;
>
> /// AuthClass constructor.
>
> public AuthClass( DBConnectionContext cc ) {
> _conn = cc.GetConnection();
> }
>
> /// The DoAuthenticate method handles the 'authenticate_user'
> /// event.
> /// Note: This method does not handle password changes for
> /// advanced authorization status codes.
>
> public void DoAuthenticate(
> ref int authStatus,
> string user,
> string pwd,
> string newPwd ) {
> DBCommand pwd_command = _conn.CreateCommand();
> pwd_command.CommandText = "select pwd from user_pwd_table"
> + " where user_name = ? ";
> pwd_command.Prepare();
> // add a parameter for the user name
> DBParameter user_param = new DBParameter();
> user_param.DbType = SQLType.SQL_CHAR;
> // Set the size for SQL_VARCHAR.
> user_param.Size = (uint)user.Length;
> user_param.Value = user;
> pwd_command.Parameters.Add( user_param );
> // Fetch the password for this user.
> DBRowReader rr = pwd_command.ExecuteReader();
> object[] pwd_row = rr.NextRow();
> if( pwd_row == null ) {
> // User is unknown.
> authStatus = 4000;
> } else {
> if( ((string)pwd_row[0]) == pwd ) {
> // Password matched.
> authStatus = 1000;
> } else {
> // Password did not match.
> authStatus = 4000;
> }
> }
> pwd_command.Close();
> rr.Close();
> return;
> }
> }
> }
>
>
> Ö´Ðйý³ÌÖУ¬mobilink·þÎñÆ÷Ìáʾ³öÏÖ´íÎó
> ûÓÐΪÀàAuthClassÕÒµ½ÓÐЧµÄ¹¹Ô캯Êý¡£
>
> Ìí¼Ó´úÂ룺
> public AuthClass() {}
> ºó£¬ Ö´ÐÐDoAuthenticate ʱ£¬Ìáʾ´íÎ󣬸ú×Ù·¢ÏÖ£¬DBCommand pwd_command =
> _conn.CreateCommand();
> ³ö´í¡£
>
> Çë½ÌÄÄÀï³ö´íÁË
>
>
>