ความปลอดภัยของเว็บ - IsCurrentUser()
❮ ความปลอดภัยของเว็บ
คำนิยาม
วิธีIsCurrentUser()จะเปรียบเทียบชื่อผู้ใช้ที่ให้ไว้กับชื่อผู้ใช้ที่เข้าสู่ระบบ
ไวยากรณ์ C# และ VB
WebSecurity.IsCurrentUser(userName)
พารามิเตอร์
Parameter | Type | Description |
---|---|---|
userName | String | The user name to compare |
คืนมูลค่า
Type | Description |
---|---|
Boolean | true if the userName parameter matches the logged in user, otherwise false |
ข้อผิดพลาดและข้อยกเว้น
การเข้าถึงวัตถุWebSecurity จะส่ง InvalidOperationExceptionหาก:
- ยังไม่ได้เรียกเมธอดInitializeDatabaseConnection()
- SimpleMembershipไม่ได้เริ่มต้น (หรือปิดใช้งานในการกำหนดค่าเว็บไซต์)
❮ ความปลอดภัยของเว็บ