C# to VB.NET help(ASP.NET Web App) Enviroment Codes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Daxthecon
    New Member
    • Jul 2008
    • 63

    C# to VB.NET help(ASP.NET Web App) Enviroment Codes

    I know how to get the server information on the user but the former programmer did all this in C# and I have to do it in VB. Now he took the easy way out and only called certain directory attributes out for the stuff he knew. I am left sifting through all his code trying to find out how to get to the attributes he couldn't. There are hardcoded permissions so I can't post the code on a public website.

    But I can write some Pseudo Code:
    Code:
    if (username == "director_it")
    			{
    				name.Visible = true;
    				changename.Visible = false;
    				changename.Value = "manager/officelocation/employeename/Phonenumber";
    			}
    
    
    			reqdate.Text = DateTime.Now.Month.ToString() + " - ";
    			reqdate.Text += DateTime.Now.Day.ToString() + " - ";
    			reqdate.Text += DateTime.Now.Year.ToString();

    This is just one instance of this there are more for the managers in each dept. But thats not the half of it. What I want to do is have a table with information already filled in Ex:

    Code:
    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
            usenamelbl.Text = Page.User.Identity.Name
            loclbl.Text = Page.User.
            datetimelbl.Text = Date.Today
            nametxt.Text = Page.User.Identity.Name
            datetext.Text = Date.Today
            phonetext.Text = Page.UniqueID(I am not sure how to do this one)
            emailtext.Text = Page.User.Identity.Email(example purposes only)
        End Sub
    What I am asking help on is the fact that I want to know how to go about diagnosing where these directories might be and when I find them how to call them. Now you may not be able to tell me how to find them but I really want to know how to call these things without hardcoding them as the last person did. That just seems like more work and after I get this one done and know how to do it then I won't have worry about how to do it next time. I am so new at this Web Application thing. It was so much easier in Software Applications.

    Thanks in Advance.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    I didn't see any directories listed?

    If the directories are directly related to a managed domain (there is a domain controller) then you should be able to use ActiveDirectory objects to find them?

    Comment

    • Daxthecon
      New Member
      • Jul 2008
      • 63

      #3
      Thats the thing no one here can tell me if they are or aren't. It's like some bit secret. I have looked through all the code and the references to files or any server has come up as an empty quest to find just system files. The only thing I can figure in my 3 hours search since posting this is that it is hidden somewhere in the depths of the IIS. But I've been through the IIS a couple times and the references in the code are something I don't quite understand since most the files are still php save a few newer ASP.NET/C# builds.

      Thanks for you help though. I am completely confused and frankly so is everyone else in the office.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        I'm still not even sure what you are trying to find?

        Comment

        • Daxthecon
          New Member
          • Jul 2008
          • 63

          #5
          An idea of where the AD might be or a way to force access to using Global VB commands.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Well using ActiveDirectory is similar to using a database.
            I'm not too familiar with it, but there's a whole namespace out there for it I think.
            MSDN ActiveDirectory in.Net maybe?

            Comment

            • Curtis Rutland
              Recognized Expert Specialist
              • Apr 2008
              • 3264

              #7
              System.Director yServices

              Comment

              • Daxthecon
                New Member
                • Jul 2008
                • 63

                #8
                Thank you lots. I have had a break through with all this code. What I thought was code pointing to files as the AD or Service Directory was just simple write to and read from(I can't read php as well as I can VB). He never tried to use AD there is non of that in his code or anything referencing in it. The confusion comes from the fact that he has all these labels that tell you what office you are in and who you are and what your phone number is making you think that there is some directory. Well it's sorta a smoke and mirrors trick. All he did was find pieces of public or global variables that he could read from(i.e. environment and ip numbers) and used filters and arrays to match a string to the output that is given in the labels and text boxes. 192.168.0.159 = NY office and so on... that was just an example. Thanks for the help guys. I wish all my problems where being a newbie problem. But some of them are just catching up to the guy before you.

                Comment

                Working...