understanding code written in jscript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnuSumesh
    New Member
    • Aug 2007
    • 96

    understanding code written in jscript

    Hi


    i have one asp file which is using jscript.
    There is one dll file named shareaccess.

    Code:
    var obj;
    obj = new ActiveXObject("ShareAccess.ShareEnum");
    
    var collection = obj.AdmLoadDomains();			
    for(i = 0 ; i < collection.Count ; i++)
    {
    	try	
    	{						
    		Path = collection(i).Path;
    		Type = collection(i).Type;
    		NFS = collection(i).NFS;
    		Marked = collection(i).Marked;
    	}
    }
    I am unable to understand this code.
    What is the return type of obj.AdmLoadDoma ins();?

    I have also written a method using c# which returns a dictionary object and created dll file. When i am using that dll in asp and calling that function using following code
    Code:
    var dic= myonj.getDomains();
    dic is null. but actually it should return one key-value pair.
    I have tested same dll in c# program and its successfully returning key-value pair.

    Please help me ....
    Its urgent.

    Regards,
    Anu
    Last edited by acoder; Nov 13 '08, 01:29 PM. Reason: Moved to ASP
  • Nicodemas
    Recognized Expert New Member
    • Nov 2007
    • 164

    #2
    It's a dictionary. Just like VBScript dictionaries.

    The items in that dictionary appear to have propreties of their own, too.

    To find out their data type, you can use JScript's type name lookup function TypeOf. It is used as defined below:

    Code:
    <%@LANGUAGE="JScript"%>
    <%
    var x = "123";
    Response.write(typeof(x));
    %>

    Comment

    • AnuSumesh
      New Member
      • Aug 2007
      • 96

      #3
      Hi

      Thanks for reply.

      typeof(collecti on) returns "object" but how can i know which object it is?
      typeof(collecti on(i).Path) returns "string".

      I have written function in c# which retyrns dictionary object and called that function in asp same as above but its returning error.

      Can you help me further?

      Anu

      Comment

      • Nicodemas
        Recognized Expert New Member
        • Nov 2007
        • 164

        #4
        Object should be the correct value typeOf() returns.

        Comment

        Working...