2013年12月23日 星期一

ASP.NET IE10,IE11 要在相容性檢視下才正常

ASP.NET IE10,IE11 要在相容性檢視下才正常
這個問題已經困擾許久,一直找不出解決方式,尤其是最近 User 的瀏覽器陸續升級到 IE 11 ,短期的解決方式是將網域加入相容性檢視清單,但畢竟這不是永久解決的方式

更新 Developer Express 13.2 ,但仍無法解決問題

但後來找到了
http://blogabhijeet.blogspot.in/2013/10/ie11-and-windows-81-solution-for.html
他有一些建議的解決方式

其中這一項是 MS 的 Hot fix
http://www.microsoft.com/zh-tw/download/confirmation.aspx?id=39257
我們是 Windows 7 , Windows 2008Server 64bit  ,故下載 64 bit 的版本
NDP40-KB2836939-v3-x64.exe

重啟  IIS 後終於解決了長久以來的問題了

2013年12月10日 星期二

Toptop 顯示目前線上人數


/* 顯示目前線上人數 */
/* 可以在 Linux 下 kill -9 PID ,就可以趕它出去 */
select * from gbq_file
order by GBQ03

/* 顯示1天前登入的人員列表 */
select * from gbq_file
where to_date(gbq07,'yy/MM/dd hh24:mi:ss') < sysdate -1
order by GBQ03

2013年1月30日 星期三

OpenLdap Authorization


最近要做 OpenLdap 的 Authorization , 但是一直 try  不成功,直到看到以下的回覆,真的是幫助很大

http://www.cnblogs.com/wangyt223/archive/2012/10/09/2716077.html


(转)DirectoryServices访问OpenLdap的若干问题

DirectoryServices访问OpenLdap的若干问题 (入选推荐日志,加10币)
      昨天晚上快2点才睡,终于把使用DirectoryServices访问OpenLdap的所有问题都解决了,这方面的资料好像国内的不多,遇到很多问题都是自己摸索,或者在国外的论坛上看到的。
       1.DirectoryEntry的AuthenticationTypes必须设置成ServerBind
       2.ldap直接认证,可以使用DirectoryEntry.NativeObject,只要不返回错误,就可以认为认证成功
       3.搜索可以使用DirectorySearcher,调用 mySearchResult.GetDirectoryEntry可以对搜索项进行修改
       4.Attribute Types 为Octet String 的必须string和asc byte数组类型之间转换(该类型一般用在password上)
       5.新加用户使用DirectoryEntry.Children.Add的方法,该方面有两个参数,一个是dn,另一个为加入的Schema 的objectclass(注意千万不要忘记了所有在Schema中定义的必填项,否则会返回LDAP_NAMING_VIOLATION的错误)
       6.当然,任何修改都需要.CommitChanges()
       另外还有个遗留的小问题,Adsi Edit无法访问  OpenLdap,不知道是不是设置有问题

把 code 放上來,以供日後參考
public static string ValidateUser(string ComputerName, string UserName, string Password)
        {
            string strPath;
 
            if (ComputerName.IndexOf('.') != -1)
            {
                strPath = string.Format("LDAP://{0}:389/DC=alchip,DC=com",ComputerName);
                UserName = string.Format("uid={0},ou=Users,DC=alchip,DC=com",UserName);
            }
            else
            {
                strPath = string.Format(@"WinNT://{0}/{1}, user", ComputerName, UserName);
            }
 
            DirectoryEntry entry = new DirectoryEntry(strPath, UserName, Password,AuthenticationTypes.ServerBind);
          
            
            try
            {
                //string objectSid =
                //      (new SecurityIdentifier((byte[])entry.Properties["objectSid"].Value, 0).Value);
 
                //return objectSid;
 
                if (entry.NativeObject != null)
                    return "true";
                else
                    return null;
            }
            catch// (DirectoryServicesCOMException)
            {
                return null;
            }
            finally
            {
                entry.Dispose();
            }
        }

Crystal Report 加總功能失效


有一支報表的表尾加總出現了問題,總是只有出現第一筆數量,而非加總的數量

1. 在群組欄位中按右鍵->插入->摘要,則可以在報表尾產生一個加總的資料
2. 或在報表尾按右鍵加入欄位


但是不知道是不是這樣子就可以一勞永逸 ? 於就是檢梘了加總的欄位設定
有一些許的差異,改掉之後報表的加總欄位就又可以運作了...