连接字符串中的Integrated Security=SSPI 是什么意思啊?有用吗??

解决方案 »

  1.   

    http://topic.csdn.net/t/20020422/09/665662.htmlSecurity   Support   Provider   InterfaceThe   Security   Support   Provider   Interface   (SSPI)   allows   an   application   to   use   any   of   the   various   security   models   available   on   a   computer   or   network   without   changing   the   interface   to   the   security   system.   SSPI   does   not   establish   credentials   (logon),   because   that   is   generally   a   privileged   operation   handled   by   the   operating   system.   
        
      A   security   provider   is   a   dynamic-link   library   that   implements   the   Security   Support   Provider   Interface   to   make   one   or   more   security   packages   available   to   applications.   Each   security   package   provides   the   necessary   mapping   between   the   SSPI   and   the   actual   security   model,   such   as   Kerberos   or   Microsoft   LAN   Manager.     
        
      An   application   can   use   the   package   management   functions   to   list   the   security   packages   available   and   select   one   to   support   its   needs.   The   application   then   uses   the   credential   management   functions   to   obtain   a   handle   to   the   credentials   of   the   user   on   whose   behalf   they   are   executing.   With   this   handle,   the   application   can   use   the   context   management   functions   to   create   a   security   context   to   a   service.   A   security   context   is   an   opaque   data   structure   that   contains   the   security   data   relevant   to   a   connection,   such   as   a   session   key,   the   duration   of   the   session,   and   so   on.   Finally,   the   application   uses   the   security   context   with   the   message   support   functions   to   ensure   message   integrity   and   privacy   during   the   connection.
      

  2.   

    搜到的另外一個Microsoft安全支持提供器接口(SSPI)是定义得较全面的公用API,用来获得验证、信息完整性、信息隐私等集成安全服务,以及用于所有分布式应用程序协议的安全方面的服务。应用程序协议设计者能够利用该接口获得不同的安全性服务而不必修改协议本身。 
      

  3.   

    ADO.net 中数据库连接方式
    System.Data.SqlClient.SqlConnection
    常用的一些连接字符串(C#代码):SqlConnection conn = new SqlConnection( “Server=(local);Integrated Security=SSPI;database=Pubs“);SqlConnection conn = new SqlConnection(“server=(local)\NetSDK;database=pubs;Integrated Security=SSPI“);SqlConnection conn = new SqlConnection(“Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind;“);SqlConnection conn = new SqlConnection(“ data source=(local);initial catalog=xr;integrated security=SSPI;
    persist security info=False;workstation id=XURUI;packet size=4096; “);SqlConnection myConn  = new System.Data.SqlClient.SqlConnection(“Persist Security Info=False;Integrated
    Security=SSPI;database=northwind;server=mySQLServer“);SqlConnection conn = new SqlConnection( “ uid=sa;pwd=passwords;initial catalog=pubs;data source=127.0.0.1;Connect Timeout=900“);更多字符串连接说明请看MSDN:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic.asp
      

  4.   

    简单来讲
    Integrated Security=SSPI是指连接数据库时用信任连接,也就是数据库里面通常所说的windows登陆
    如果你在程序里面提供用户名及密码,也就是用户帐户登陆模式就不需要写上面的语句了
      

  5.   

    再请教,这样的字串可以吗?
    cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                "Data Source=" & Trim(txtServer.Text) & ";Initial Catalog=" & master & _
                ";uid=" & Trim(txtUser.Text) & ";pwd=" & Trim(txtPwd.Text)
      

  6.   

    Persist Security Info所在命名空间:system.data.oledb
    Initial Catalog所在命名空间:system.data.sqlclient
    两者不在一个命名空间无法同时出现在同一字符串中
    如果连接oledb数据源用oledb,如果连接sql数据源用sqlclient
    lz的写法可以
    不过要注意连接的数据源
      

  7.   

    用msdn查一查连接字符串,你会得到很好的帮助