Fungus1487 55 Posting Pro in Training

or use the built in method

session_destroy();
PinoyDev commented: useful +1
Fungus1487 55 Posting Pro in Training
function validateRBL(RBLid)
{
   ...
    if ( isItemChecked == false ) {
        var answer = confirm ("Please confirm selection...")
        if (answer) {
            wasOkPressed = true; /* You forgot to set the global flag */
            return true;
        } else {
            return false;
        }
    }
    ...
}

You forgot to set the global 'wasOkPressed' flag after someone has selected Ok in the confirm dialog, this is how it knows whether to keep on validating. good luck.

Fungus1487 55 Posting Pro in Training

Following code should set you on the right path.

var wasOkPressed = false;

// Create an array of your checked controls
var controlArray = [ '<%= T_selector.ClientID %>', '<%= P_selector.ClientID %>', '<%= Q_selector.ClientID %>', '<%= R_selector.ClientID %>' ];

function validate() {
    wasOkPressed = false;

    // Loop through each control
    for(var i = 0; i < controlArray.length; i ++) {
        if (!wasOkPressed ) { // If ok was not pressed keep validating
            if (!validateRBL(controlArray[i])) {
                // If control fails to validate return false
                return false;
            }
        }
    }
    return true;
}
Fungus1487 55 Posting Pro in Training

no you cant. Microsoft have made it that way.

At least not through javascript.

If your using a server side language you could change the page headers returned to the client which would force a download of the page. But if your using bog standard html/xhtml youd have to tamper with the server which most people cant as there hosting service handles it all.

Fungus1487 55 Posting Pro in Training

easiest way to do this is with javascript and all your content in page.
Example:

with a simple HTML layout like below with your seperate "pages" content in each 'div'.

<div id="content01" class="show">
    <p>Content 01</p>
    <p>My first bit of content to show everybody</p>
</div>

<div id="content02" class="hide">
    <p>Content 02</p>
    <p>Another bit of content to show everybody</p>
</div>

<div id="content03" class="hide">
    <p>Content 03</p>
    <p>Again!!! Another bit of content to show everybody</p>
</div>

And the following CSS, you will have a page with the other content in it but only one block is visible.

div.show
{
    display:block;
}
div.hide
{
    display:none;
}

You then use javascript to change which is visible

function changeContent(contentID) {
    // Hide the 3 holders first
    document.getElementById('content01').classname = 'hide';
    document.getElementById('content02').classname = 'hide';
    document.getElementById('content03').classname = 'hide';

    // Then show the content whose ID was passed to this function
    document.getElementById(contentID).classname = 'show';
    return false;
}

Then in you menu down the side of the page you would add a javascript "onclick" event to each of the buttons so they would show different blocks

<p><a href="#" onclick="return changeContent('content01');">Show Content Block 01</a></p>
<p><a href="#" onclick="return changeContent('content02');">Show Content Block 02</a></p>
<p><a href="#" onclick="return changeContent('content03');">Show Content Block 03</a></p>

This is definately not the best method but i am assuming you dont have too much previous experience with javascript. There are free API's out there which can do alot of this for you and also use XMLHttpRequests to 'dynamically' load pages such as jQuery. I recommend you check it …

Fungus1487 55 Posting Pro in Training

It was in vb.net forum and it's just moved!!

awesome. sorry geez x

agrothe commented: Thanks again, that looped saved the day. +3
Fungus1487 55 Posting Pro in Training

i dont quite understand what you mean by "Basically I need to validate only once, if the user click OK then I don't want the js continue validate additional controls even if it is '&&'." so this could be wrong but.

in your "validate" function if you check the first method then set a global flag if the user chooses ok you can check before hitting the second validation.

var wasOkPressed = false;
function validate() {
    wasOkPressed = false;
    var firstResult = validateRBL('<%= T_selector.ClientID %>');
    return wasOkPressed ? true : firstResult && validateRBL('<%= P_selector.ClientID %>');
}
Fungus1487 55 Posting Pro in Training

You may ask in ASP.NET forum, it'd be better.

This is the ASP.net forum?


And the best way to achieve this is definately a recursive function. I dont quite understand your database structure could you ellaborate. A simple example of something would be.

Database Table Structure

MenuItem
--ID
--Name
--ParentID
' MenuItem class, to hold an instance of an item
' Not the best of ideas to hold public instance variables but for this example it will suffice
Private Class MenuItem

    Public Name As String = Nothing

    Public ID As String = Nothing

    Public Sub New(ByVal name As String, ByVal id As String)
        Me.Name = name
        Me.ID = id
    End Sub

End Class

The above code is untested and leaves out your database requests to however you are implementing this. The only trouble with thei recursive method may be if you had say 50+ levels, you may find that requesting from the database for each node will slow you down. Another way to get around this would be to gather all the nodes at the begginning in a list then select them from this list at runtime using their ID's.

Hope it helps

Private Function OutputFiles(ByVal list As System.Collections.Generic.ArrayList(Of MenuItem)) As String
    Dim html As String = "<ul>"

    For Each item As MenuItem In list
        Dim sql As String = String.Format("SELECT ID, name FROM MenuItem WHERE parentID = '{0}'", item.ParentID)
        Dim innerList As System.Collections.Generic.ArrayList(Of MenuItem) ' Fire the above SQL statement and populate …
agrothe commented: great help, thanks +3
Ramy Mahrous commented: very nice help +6
Fungus1487 55 Posting Pro in Training

Your looking for something like this http://freetextbox.com/download/ , although if you use it commercially you will have to pay them for the control. I have done this sort of thing by hand before and believe you me it is alot less hassle to use a component.

Fungus1487 55 Posting Pro in Training
<asp:RadioButtonList ID="T_selector" runat="server">

The ID you give the ASP control will change at runtime.

if (document.getElementById("T_selector").checked==false)

You need to change your hardcoded ID string to change at runtime using.

(document.getElementById('<%= T_selector.ClientID %>').checked==false)

or you can use the following if you have the Microsoft Ajax Library in your project.

($get ('T_selector').checked==false)

The id's you set for ASP controls are changed at runtime due to the server side compilation. This may seem confusing but for instance if you have a page which contains 2 user controls which both contain a textbox with id 'textName' then the document could not be well formed due to two ID's colliding, also the server would not be able to distinguish between the two on postback.

Hope this helps.

Fungus1487 55 Posting Pro in Training

yer you have it right now.

purchasing the domain simply allows you to trap requests to that address and then forward them to anywhere you like.

once you have the domain and hosting which supports ASP.net you are already to go. Just make sure you check some of their features such as maximum upload/download a month, the amount of space you get etc as you can get some very competitive rates. Generally the more you pay the better the service. Also check they are running the version of the .NET framework you require e.g. 2.0 or 3.5?

Fungus1487 55 Posting Pro in Training

Have you purchased Hosting or just the domain name?

If so you need to check if your host supports ASP.net else your projects will not work.

If they do they will provide a backend to setup a web application.

Fungus1487 55 Posting Pro in Training

Normally when you do this in C# you would have done something like this to open a new Form. Is the solution something simular to this ?

Form2 form2 = new Form2();
form2.Show();

Im just curious as to when you would do this on a web page ?

What your looking to do is

Response.Redirect = "http://www.google.com/";

having not used visual web developer i am unsure how you would go about it, but you would not want to post back to achieve this when it can be done in standard HTML unless you needed to perform some validation.

If these are ASP controls which i assume they are, a property is available to you which you can set on each of the buttons along the lines of 'PostBackURL'

Fungus1487 55 Posting Pro in Training

hey although the way your writing this can be done, it will be hard to maintain with all your permutations in the if statement. I have put together an example for you that uses lists to iterate through and uses built in Array methods to find out how many each person has.

public void StartCheck()
{
   /** Holds the lottery results, see the LotteryTicket class at the bottom **/
    LotteryTicket results = new LotteryTicket("The Lotto Results", 5, 12, 15, 9, 34, 23);

    /** Create a List of type LotteryTicket to hold each users results, you could populate this using a database **/
    List<LotteryTicket> listToCheck = new List<LotteryTicket>();
    listToCheck.Add(new LotteryTicket("Alan", 1, 2, 3, 4, 5, 6));
    listToCheck.Add(new LotteryTicket("John", 59, 58, 57, 56, 55, 54));
    listToCheck.Add(new LotteryTicket("Cheryl", 9, 4, 34, 1, 2, 23));

    /** Iterate through each ticket **/
    foreach(LotteryTicket ticket in listToCheck)
    {
        /** Counts the number of matches **/
        int numberOfMatches = 0;
        foreach (int number in ticket.Balls)
        {
            /** Compares the lottery results with the persons lottery ticket **/
            if (results.Balls.Contains(number))
            {
                /** If a match is found the number is incremented **/
                numberOfMatches++;
            }
        }
        /** Outputs a message to the console, you can change this to display your message to the web page **/
        Console.Out.WriteLine("{0} has matched {1} lottery numbers.", ticket.Name, numberOfMatches);
    }
}

/** Class to model a lottery ticket and the person who owns it **/
private class LotteryTicket
{
    /** The lottery tickets balls **/
    private int[] balls;
    /** The persons name **/
    private …
Fungus1487 55 Posting Pro in Training

is this the only factor you would use to weigh up which model to use?
In my opinion i believe that ORM is a much more technically based drawing and isnt doesnt reap the benefits that ERD has already shown and has been expanded upon with EERD.
This is only brought about from the limited exposure I have had with each, but in terms of accurately displaying a "template" i have to go for EERD. Anybody else have any definitive YES/NO's for using ORM over EERD or visa versa?

Fungus1487 55 Posting Pro in Training

Hello all,

im looking to try and find a simple set of pros and cons with regards to comparing Enhanced-Entity-Relationship Diagrams and Object Role Modelling diagrams.

Basically any plus or negatives given for/against either would be great.

Fungus1487 55 Posting Pro in Training

first of all do they need to be added dynamically? could you get away with adding them manually first and hiding/showing certain controls. You can set the index of the step so you could technically override this on postback and then alter the index given some requirement you may have.

If you must obtain this dynamically. Then you are required to rebuild all the controls on initialisation.

Example
- Create WizardStep1
- User Goes to Next Step
- On Initialization
--- Rebuild WizardStep1
--- Create WizardStep2
--- Set Index of wizard to 1 (the second step)

There are many tutorials for dynamic control postback state. Here is a good one. http://aspnet.4guysfromrolla.com/articles/092904-1.aspx

Fungus1487 55 Posting Pro in Training

Hey frnds, I m able to acess the admin tools. My website name is sonia.
I open admin tools & right click on folder sonia but hi fungus there is no custom menu "Convert To Application" . U can see it in the attachment.....

The days of IIS 5.1, beautiful. Im guessing here but have you looked under all tasks sub context menu ? Not having XP or IIS 5.1 anymore (Since 2006) i really cannot remember exactly where this is found although you dont seem to have ASP.NET installed as you should have an "aspnet_client" folder under the "Default Website"

You need to go to the add ASP.NET as a sub component of the IIS in add/remove programs on the control panel.

Fungus1487 55 Posting Pro in Training

other than majestics reason i cant think of any why you cannot gain access to administrative tools

Fungus1487 55 Posting Pro in Training

Hi frnd,there is no Administrative Tools option in Control Panel..Can u plz confirm me out...

what operating system and setup are you using ?

Fungus1487 55 Posting Pro in Training

i have to disagree here, why is it bad to hand code aspx pages? just wondering as there are many programmers/developers that program in the most basic of all programs "notepad" for HTML, CSS, Javascript, php, Java and many other languages

Using an IDE simply makes it faster to develop but doesnt at all make the process of learning the language any easier.

further to this im sorry i didnt answer your question.

If you did build this site in visual studio or an IDE then using the RUN command will run your website. I understand if you wish to set this up manually though you will need to tamper with your IIS.

You have created your directory below "wwwroot" so all you need to do is open "Control Panel >> Administrative Tools >> Internet Information Services [version no.]" then in the tree on the left navigate to the "Default Website". Expand this node and you will see your folder "Website1", right click and choose "Convert To Application", now run your url and if everthing is setup fine it will work.

If you receieve an error stating the server does not know how to handle the file type "aspx" you will need to open "Control Panel >> All Programs" then press "Add Remove Windows Features", you will need to navigate to "Internet Information Services >> World Wide Web Services" and then make sure the following are checked.
> .NET Extensibility
> ASP.NET
> ISAPI …

Fungus1487 55 Posting Pro in Training

you are missing your form tag, also it is not good idea to hand code aspx pages. try visual web developer/

i have to disagree here, why is it bad to hand code aspx pages? just wondering as there are many programmers/developers that program in the most basic of all programs "notepad" for HTML, CSS, Javascript, php, Java and many other languages

Using an IDE simply makes it faster to develop but doesnt at all make the process of learning the language any easier.

Fungus1487 55 Posting Pro in Training

hi all,
i created an web application in which i have used sessions.
when i run this application on IIS its working fine, but when i hosted on another webserver(EasyCgi) the sessions are not working.
can anybody please help. i even used Session State and Session mode in my WEB.CONFIG file.

if sessions are disabled at machine level whether or not you set them in web.config will not matter. contact your host and find out whether they support sessions and whether there is anything they have setup there end which you will be required to implement.

Fungus1487 55 Posting Pro in Training

In your first solution, could I not simply type in
http://www.mysite/yourpage.com and get to the page?

yes you would be able to locate the page but then its entirely up to your php to determine whether the incoming request should be allowed.

You could change the headers to "404" if you want a page not found error in a users browser that isnt validated

The session example abov would work but the site linking to this page would have to be on the same server for the session to take effect. I believe he was asking for a way to redirect from an external site to this page whilst authenticating.

Fungus1487 55 Posting Pro in Training

css works by nesting. so...

ul li

"li" is found below "ul"

li li

"li" is found below "li"

Example

<div>
  <ul>
    <li>
      <ul>
        <li>Text 01</li>
      </ul>
    </li>
    <li>Text 02</li>
  </ul>
</div>
ul li {
  color:#aaaaaa;
}

ul ul li {
  color:#ff3333;
}

The style for "ul li" will set all "li" elements found under a "ul" element to the color "#aaaaaa" in the example above this means all text will be of the color "#aaaaaa".

The second style for "ul ul li" will set all "li" elements found under a "ul" which is found under a "ul" to the color "#ff3333". Only the text "Text 01" will be of this color as it is the only "li" element that has been nested within two "ul" tags.

Hope this helps clarify.

daviddoria commented: Great answer. +1
buddylee17 commented: looks like you solved this one +3
Fungus1487 55 Posting Pro in Training

the bin file should be generated with your project. Are you using VS? or are you writing this by hand.

The logic you have is quite simple, the "Init" method is being called and creating a handle of the OnBeginRequest method which should have a set signature.

You are then "+=" appending the handle to the BeginRequest event. When this event is triggered it will loop through all handles that have been added to it (system and user) and trigger them.

This will then fire any code you have in your "OnBeginRequest" method.

Fungus1487 55 Posting Pro in Training

depends how far you want to take this.

For example you can easily append a unique ID for all sites you wish to link to this page e.g.

http://www.mysite/yourpage.com?token=123

you would then perform a check to see if the "token" variable equals 123.

This can be easily manipulated by somebody even with a very minimal knowledge in computing.

Another option could be to obtain a list of all sites and pages that you wish to allow links to your site and then on load of your page check the $HTTP_REFERER; variable (this contains the last page the user was refered from) if this is in your list then allow them to see the page. This has alot of downfalls as for example if someone navigates within your page you will get a refferer of your own page so would need some cookie or session handling setup to identify people. Also some browsers dont send the refering data.

If javascript is not a problem on the pages you will be linking from. You could use a <FORM> which generates and stores a token in a hidden field which you could then pass through to your page and pickup/ validate against it. Again this isnt fully secure and through a link alone you will have a tough time validating incoming users.

Perhaps something like an alternating security token will do the trick but im guessing youll want it to be alot …

Fungus1487 55 Posting Pro in Training

given a file structure as follows...

DirectoryA
  -- SubDirA
  -- SubDirB
DirectoryB
  -- SubDirA
    --  SubDirA1
  -- SubDirB

If your page (lets say "Default.aspx") is in "DirectoryA/SubDirB" like so...

DirectoryA
  -- SubDirA
  -- SubDirB
    -- Default.aspx
DirectoryB
  -- SubDirA
    --  SubDirA1
  -- SubDirB

And you want to map the path to "DirectoryB/SubDirA/SubDirA1" then your code would be written from a relative perspective. E.g.

Server.MapPath("../../DirectoryB/SubDirA/SubDirA1/")

This string "../../DirectoryB/SubDirA/SubDirA1/" is broken down as follows.

"../" - From 'Default.aspx' go up one directory to "DirectoryA"
"../" - From 'DirectoryA' go up one directory to the root
"DirectoryB/" - From the root go into "DirectoryB"
"SubDirA/" - From 'DirectoryB' go into "SubDirA"
"SubDirA1/" - From 'SubDirA' go into 'SubDirA1'

And that pretty much is your server.MapPath explained. It simply requires a path relative to your current executing page. The error your receiving will probably be due to the fact your relative path does not exist.

Fungus1487 55 Posting Pro in Training

yo havent implemented all of your interfaces methods so far as i can see in the class FocusView you have implemented Idecrypt and login.

your IEncrypt method in FocusView is not implementing the method IEencrypt in the interface and you are missing, compress, decompress and logout

to implement an interface to your class you must initialise all of its methods.

public class FocusView : IEncrypt, Icompress, Iauth
{

  public void IEencrypt()
  {
    Console.WriteLine("encrypt");
  }
  public void Idecrypt()
  {
    Console.WriteLine("Decrypt");
  }

  public void compress()
  {
    Console.WriteLine("Compress");
  }
  public void decompress()
  {
    Console.WriteLine("Decompress");
  }

  public void login()
  {
    Console.WriteLine("login");
  }
  public void logout()
  {
    Console.WriteLine("login");
  }

}

on another note you need to implement your methods publicly else you are not implementing the interface as it is required.

Fungus1487 55 Posting Pro in Training

onclick="window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180')"
href="javascript:;"

Try

onclick="window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180');return false;"
href="javascript:void(0);"

And if that fails you could always try

onclick="var w = window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180');w.focus();return false;"
href="javascript:void(0);"
Fungus1487 55 Posting Pro in Training

are you running this locally on your computer or via a website ?

if its locally you will recieve this error through IE to disable it. Set your security settings to low/intranet in IE.

Fungus1487 55 Posting Pro in Training

Also, call me crazy but i prefer to code in php.

your crazy :P

Fungus1487 55 Posting Pro in Training

Theres two ways to fix this. The following adds a div to push the outer box down below the floated element.

<div class="row" id="rowTxt">
<div class="left"><label for="enq">Enquiry <br /><span class="small"> Please enter a general enquiry</span></label></div>
<div class="right"><textarea name="enq" id="enq" rows="5" cols="40"></textarea><br /><span class="err" id="enqErr">Invalid Entry</span></div>
<div style="display:block;width:100%;" />
</div>

Or

You can set a height to your row in your CSS like so...

#rowTxt {
    height:80px;
}

Using this second method it would be better to assign a "height" style to the text area so you could manage the height of the row with the text area. Else the first method will allow the height of the textarea to be dynamic allowing for crossbrowser differences in the "rows" html attribute.

Fungus1487 55 Posting Pro in Training

this will only work in IE at best.

If thats not a problem then we need to see your "B.aspx" page to see what is going wrong.

If cross browser issue is a problem try looking into the "ajaxControlToolkit" available here. It contains a managed way of creating in page modal dialogs.

Fungus1487 55 Posting Pro in Training

it would be something like the line-height property of the left hand labels adding a sort of padding to your element. So the actual height of this element is larger than your inputs but not the height of the textarea. When your error messages come to render themselves they all have the left hand labels extra height to push them across the screen.

A better solution would be.

<div class="holder">
    <div class="left">
        ... label and other elements
    </div>
    <div class="right">
        ... text area and other elements
    </div>
</div>
.holder
    {
        display:block;
    }

    .holder .left
    {
        float:left;
        width:300px;
    }

    .holder .right
    {
        margin-left:300px;
        width:auto;
    }
Fungus1487 55 Posting Pro in Training

First of all to stop your input/textareas from bouncing everytime you focus them do this.

input,textarea {
    height: 1.5em;
    width:  15em;
    padding: 0;
    [B]margin: 1px 1px 1px 1px;[/B]
    border: 1px solid gray; 
    font: 11px "Lucida Sans Unicode", Verdana, Arial; 
    color: #666;
}
input:focus, textarea:focus{
    border-width: 2px;
    border-color:    #d5dae7;
    [B]margin:0px[/B]
}

The problem you are having with the text not aligning itself to the textarea is that the span element has no element to force it into the position you require.

Add the following to your code. 310px is the sum of your label width (290px) + label left margin (10px) + label right margin (10px).

[B]#enqErr {
	margin-left:310px;
}[/B]

Hope this helps.

Fungus1487 55 Posting Pro in Training

You cant.

Not just using javascript.

With IE you can get your user to set there browser settings to low and it will let them do this but firefox or any other browser will not allow it as its a major security leak.

The best ways i have seen/and done this are the following 2 methods.

1) Create a web service page to give to your client/supplier which calls the webservice on a seperate domain. Then call the "same domain" web service in your javascript. The server side code wont have any restrictions on cross domain interaction.

2) Create a flash object which initialises XMLHTTP as flash doesnt have any objections to retrieving data across domains. Then when you have read all your info into your flash movie pass the data to your javascript in the same page.


Option 1 Seems to be a more elegant solution but if your page is flash heavy then maybe there is a possibility you could use this technique. There seems to be some movement towards creating a standard to allow cross domain interaction but i cant see it coming to light for javascript for a very long time if ever.

Hope this helps

Fungus1487 55 Posting Pro in Training

Integrate an ASP.NET WebService into your application. Webservices provide a much better means of transferring/receiving data externally via the web than simply posting values to a page, the vb.net app can then "Consume" the web service creating integrated classes into your forms application allowing you to call your external methods within 2 lines of code. The link below shows how to setup a demo webservice.
Web Service Example

Fungus1487 55 Posting Pro in Training

Secondly I find ASP slower in comparison to PHP or JSP.

Alot of people throw this quote about but there is no reason ASP.net websites shouldn't be as fast (or faster) than php sites. It simply comes down to coding practices and optomizing performance.

I would consider what level of interaction/features your users will require. As persoannyl i find it easier to build a "Richer" interfcae using .Net rather than PHP. But again there is no reason why this should be the case. But i do agree with peter_budo...

I would go with PHP as it is community driven

that a social networking site would more than likely work best in a community driven environment

Fungus1487 55 Posting Pro in Training

dont use absolute layout. Ever!

this is probably gonna be the answer you will get everwhere but simply spending a day learning HTML/CSS coding practices will reap the rewards.

Fungus1487 55 Posting Pro in Training

I dont believe you can do this solely through .Net you would require either a flash interface or an active X control to use a webcam.

Fungus1487 55 Posting Pro in Training
Name: <%= Page.Request("nameField") %> <br />
Age: <%= Page.Request("ageField") %> <br />
Comment: <%= Page.Request("commentField") %> <br />
Fungus1487 55 Posting Pro in Training

It will be todo with your max upload limit on the server you are using aswell. Most will not let u alter this unless u own the server.

Fungus1487 55 Posting Pro in Training

look into using the ModalPopupExtender from the ajaxtoolkit. It really is great and stops all the cross browser nonsense of manually coding javascript popups. ModalPopup Example

Fungus1487 55 Posting Pro in Training

System.Web.UI.HtmlControls

Fungus1487 55 Posting Pro in Training

I'm really having hard time importing ASPNETDB.mdf to remote server running sqlserver 2005..
I'm using sql server express edition (along with visual web developer 2008)
I use the same string
<add name="aspnetusers" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
No connection can be established....

Then I changed that to
<add name="aspnetusers"
connectionString="server=(local);AttachDBFilename=ASPNETDB.mdf;Integrated Security=True;" providerName="System.Data.SqlClient"/>
I gives error
CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file ASPNETDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

I even copied(replicated) entire database to my remote server
but some stupid schematic version problem arises....

My control panel is PLESK

Please help me out how to fix this common problem....

do you have permissions on this remote machine to create a database. you will need an account which has the nescessary permissions to auto generate a db.

jh00 commented: nice pic +0
Fungus1487 55 Posting Pro in Training

You need to force the browser to refresh it looks like. Im afraid the easiest method is to change its name. maybe you could add a time to the end of the file i.e. "filename_20080607.jpg" etc.

Jihad commented: good suggestion +1
Fungus1487 55 Posting Pro in Training

Yer it actually is running brilliantly.

Thanks for all your help.

It just a shame that it requires a mixture of all the above methods to get something that works across all major windows OS versions and network setups. Ah well.

Fungus1487 55 Posting Pro in Training

Ok after a couple of hours looking into this problem i have come up with a solution which works just about everywhere i have tested it. I have stripped it to its bare bones and im sorry about the lack of commenting. I have wrote all this up in a nice wrapper Class to handle all the messy business behind the scenes yet posting this up here would be too cumbersome. If someone would like me to send them the wrapper class id be happy to. Simply contact me.

Ill Post below for anybody else who may have a similiar problem.

Method to Get Computer names and IP Address's in a domain
This method uses the LDAP protocol and requires the use of active directory

' Change "yourdomainname" to quite simply the domain you wish to query
Dim strLdap As String = "LDAP://yourdomainname"
Using dirEntry As New System.DirectoryServices.DirectoryEntry(strLdap)

    ' Create a new Search Result Collection to hold the returned values
    Dim dirSearcRes As System.DirectoryServices.SearchResultCollection = Nothing
    Using dirSearch As New System.DirectoryServices.DirectorySearcher(dirEntry)
        dirSearch.Filter = "(objectClass=computer)" ' Filter computers
        dirSearcRes = dirSearch.FindAll
    End Using

    ' Loop through search results
    For Each resSearch As System.DirectoryServices.SearchResult In dirSearcRes
        Try
            Using resEntry As DirectoryServices.DirectoryEntry = resSearch.GetDirectoryEntry
                
                ' Do what you wish with the following computer name and IP Address variables
                Dim strComputerName As String = resEntry.Name.Substring(3),
                Dim strIpAddress As String = System.Net.Dns.GetHostEntry(strComputerName).AddressList(0).ToString
            End Using
        Catch ex As Exception ' Catches computers with no name
        End Try
    Next
End Using

If you dont …

Fungus1487 55 Posting Pro in Training

Hey there majestic0110. Thanks for the reply. I have taken a good look through the article to no avail. I dont think it quite hits home on the concept i am trying to get working. After alot of browsing i have come across some nasty approaches to the technique i am looking to use.

What i require is a list of all computers on a local network domain so in turn i can get there individual IP addresses.

I have found plenty of advice in getting IP addresses of computers in the same domain using their computer names but this requires the application to know all the names of the computers in the network to begin with.

As of yet still have not found anything which looks tidy and im starting to doubt there is a "tidy" way to do this.

Alot of approaches are using "LDAP" but i frequently recieve a "Server is not operational error" wheneve rusing this approach. this example shows what i am attempting to do. http://www.vb-tips.com/ADListComputers.aspx


Again thanks for your reply and if you can be of any help it would be great.