Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Saturday, March 31, 2012

subst command or maybe network access issue

I'm trying to open an xml document on my computer. It is on a subst drive
f. I get a System.IO.DirectoryNotFoundException when I try to open the
file. When I switch to the C drive it works fine. I gave aspnet user admin
right to make sure it wasn't a permission problem but I am still getting the
exception whatever I do unless I look at my C drive. Any idea what gives?

Thanks guys.
Chris"Chris" <cf@.NoSpamzieQuotepro.com> wrote in
news:e2H7fPO9DHA.2432@.TK2MSFTNGP10.phx.gbl:
> I'm trying to open an xml document on my computer. It is on a subst
> drive f. I get a System.IO.DirectoryNotFoundException when I try to
> open the file. When I switch to the C drive it works fine. I gave
> aspnet user admin right to make sure it wasn't a permission problem but
> I am still getting the exception whatever I do unless I look at my C
> drive. Any idea what gives?

Are the other drives you having trouble with by chance network drives?

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Monday, March 26, 2012

Suggestion for App

I am trying to do a web page with a network status on it for several apps. I have tried it one way and posted it here but no replies. Any suggestions on how to have it ping a server with many different servers with online if it gets a reply or offline if it gets the time out or cant ping. Any helpe would be appreciated.

Thanks

To simply ping a server it is as simple asMy.Computer.Network.Ping("hostnameOrIp")

It will return true or false.


Cool. What I am trying to do is take that information and put in a page that says Online or Offline. But I have several Servers to do this. Any suggestions? Thanks for replying by the way.

Well, do one ping per server :P The way ping works is that it tries to send small packets to the destinated IP, if the data gets through we have PING! (funny word btw ;-). Things will get a bit different if you want to check if the server answers on specific ports. But just to do ping on several servers is piece of cake:

If My.Computer.Network.Ping("server1") = true
response.write("Online")
else
response.write("Offline")
end if

If My.Computer.Network.Ping("server2") = true
response.write("Online")
else
response.write("Offline")
end if


I would setup an ArrayList to hold all the servers, then loop through them, ping, and print their status:

Dim arrServersAs New ArrayList()Dim intCountAs IntegerDim strMessageAs StringarrServers.Add("192.168.1.100")arrServers.Add("192.168.1.101")arrServers.Add("192.168.1.102")For intCount = 0To arrServers.Count - 1 strMessage ="Server " &CStr(arrServers(intCount))If My.Computer.Network.Ping(arrServers(intCount))Then strMessage +=" is online"Else strMessage +=" is offline"End If Response.Write(strMessage)Next
 
Hope this helps! Please do not forget to mark the helpful post(s) as Answer so future readers know what solved your problem.

MY is requiring declaration and where is it to be declared?

IfMy.Computer.Network.Ping(arrServers(intCount))Then


Are you using ASP 1.x or 2.0?
2.0

Well that is really strange, becuase My works just fine and I have tested it.

It should be an automatically inherited namespace. I guess the only thing I can suggest you to try it to put

Imports My

at the top of the code behind.

Also, are you using C#?


Heck no. I can't stand anything to do with C. LOL I am using VB.

It works to an extent. I have about 14 servers I do this and I want to be able to do:

XXX Online or XXX Offline

YYY Online or YY Offline

Right now it is accounting all of the being online becasue it is going to the first one.


Thanks,


I got it to work. I had to alter some of the code. I got rid of the arrays and the loop. I did use the rest of your coding. I appreciate your help.
Glad you got it working! Please mark the most helpful post(s) asAnswer for the sake of future readers. Thank you.

Tuesday, March 13, 2012

Switch from ASPNET/NETWORK SERVICE Account

Hi,

I have a page which requests info from a number of machines and whenever I try to do this I get an 'access is denied' error message. How do I change the account that my page is using to one which actually has access to the machines.

Thanksthere is not really a straight-forward answer to this.

if all of these servers are on the same domain, then you will ba able to impersoninate a common user in the web.config ..

<identity impersonate="true" userName="domain_name\user" password="password"/
make sure this user has the appropiate permissions on all the folders your are trying to access.

by default, the ASP.NET Machine Account is used for all requests.

psi
thanks psi
see if the framework and/or the ASP.NET Machine Account is on all machines ... if it is, and all the servers are on the same domain, you should be able to set the service to network service ...

psi
Is there any other way I could do this? There is a single account on the domain that I can use but its password is changed frequently and it is a account which my boss would prefer not to have hard-coded into the web.config file.

Thanks again,
Tomas