Three typical scenarios:
 
1.asp.net(SharePoint) website
   You need to add the node in the web.config of <httpModules> the following parameters:
   <httpModules>
   <add name="WebsiteVisit" type="NetOpen_System.Component.WebsiteVisitHttpModule,    NetOpen_System.Component.WebsiteVisit"/>
</httpModules>
 
2.SharePoint website
   As an independent logging site logging on sharepoint site,the website added JS code is as follows:
 
<script type="text/javascript" >
 
 SP.SOD.executeOrDelayUntilScriptLoaded(runMyCode, "SP.js"); 
 
  var currentUser = null;
  var currentUserTitle=null;
 
 function runMyCode() {
    var ctx = new SP.ClientContext.get_current();
    var web = ctx.get_web();
    ctx.load(web);
    var user = web.get_currentUser();
    user.retrieve();
    ctx.executeQueryAsync(
        function () {
                    //only in the success case you can work with user login
          
           currentUser= user.get_loginName();
           currentUserTitle = user.get_title();
         
      
            document.getElementById("randimg").src="http://webloggersite/Default.aspx?UserName=" +currentUser+"&UserTitle="+currentUserTitle;
         

        },
        function (data) {
            //notify the failure
           
    });
   
}
</script>
    <img id="randimg" name="randimg" src="" style="width:0;height:0;" />

Implementing stories , please refer to my following URL:

http://www.cnblogs.com/nbpowerboy/archive/2013/06/13/3133169.html

3.Other website(PHP,JSP,ASP)
   the website added JS code is as follows:
    <script type="text/javascript">
       function addImg(isrc) {
           var Img = new Image();
           Img.style = "width:0;height:0;";
           Img.onload = function () {
               document.body.appendChild(Img);
           }
           Img.src = isrc;
       }
       addImg("http://webloggersite/Default.aspx");
</script>
    <img id="randimg" name="randimg" src="" style="width:0;height:0;" />
 
Automatically generated configuration logging database(Sqlite):
NetOpen_SystemWebsiteVisit.cfg.xml
<?xml version="1.0" encoding="utf-8" ?>
<NetOpen_System>
  <WebsiteVisit>
    <!--DateSource Automatic Generation of Database File year:one year month:every month day:every day None:Does not generate -->
    <SQLiteConnectings DataSource="~/Visit_Data/HomeWeb" Password="12345678" DateSource="day" Website="" ExcludeUrl="" DecodeUrl="" TextDecoding="utf-8" ExcludeUserAgent="" WebCookiesName="" WebCookiesExpires="3650"/>
  </WebsiteVisit>
</NetOpen_System>

Last edited Jun 26, 2013 at 7:54 AM by hzpowerboy, version 5

Comments

No comments yet.