Getting Computers Name Using C # Code?

Jul 12, 2010

I am using this code in cs file into an asp.net page for getting ip address from the loggeg user:

cmd.Parameters.AddWithValue("@ip",System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]);

I would like to have also his computer name, as well?!

View 1 Replies


Similar Messages:

How To Get A List Of All The Computers Within A Domain

Mar 1, 2011

I have a code to get a list of all the computers within a domain. Now i need to just get the computers which are within a particular OU and not the rest of the machines. so here is my code to get all the machines from a domain, this works perfectly fine:

DirectoryEntry entry = new DirectoryEntry("LDAP://" + selectDomain);
DirectorySearcher mySearcher = new DirectorySearcher(entry);
mySearcher.Filter = ("(objectClass=computer)");
mySearcher.SizeLimit = int.MaxValue;
mySearcher.PageSize = int.MaxValue;
foreach (SearchResult resEnt in mySearcher.FindAll())
{
//"CN=SGSVG007DC"
string ComputerName = resEnt.GetDirectoryEntry().Name;
if (ComputerName.StartsWith("CN="))
ComputerName = ComputerName.Remove(0, "CN=".Length);
compList.Add(ComputerName);
}
mySearcher.Dispose();
entry.Dispose();

View 3 Replies

VS 2008 - Measuring Connection Between Two Computers?

Nov 15, 2010

I would like to objectively measure the connection speed and quality beetween few hosts in one country and a server located in the other country.

Server has disabled pings.

View 9 Replies

Configuration :: Can't Browse Web Project From Other Computers In LAN

Jan 16, 2011

I am new in ASP.net. I published my web project using the steps stated in below address

[URL]

Now i am able to browse my project using the below url

http://COMPUTER_NAME/PROJECT_NAME/Default.aspx

and

http://IP_ADDRESS/PROJECT_NAME/Default.aspx

but form other computers in the LAN i can't access it.

View 6 Replies

C# - Establish Connection Between 2 Computers On Internet

Dec 28, 2010

I am having a domain name and web space (the web is running, its ASP.net 3.5). I am working on a project in which I need to connect 2 computers over the internet.

Is it possible to do that with a simple ASP.Net website? What other things I do need to do this?

EDIT
Actually I want to send the data from one computer to another in real time, I mean as we do chatting we exchange text to one another. The same thing I want to achieve.

View 3 Replies

How Messages Flow Between Computers Connected With Internet Or LAN

Jun 15, 2010

I have been doing Windows programming in .Net since last two years. Now I am shifting to web programming so I just stuck in understanding the fundamentals of web programming, after googling I came to StackOverflow to learn from all of you great guys.

My confusion is about how messages flow between systems in distributed enviornment ? I mean suppose I want to send a message "Hello" to a system connected to LAN or Internet, then what will be the steps taken to send the message.

Second thing is suppose my system is "A" and I wana send message to system "B" which is connected via a wire, so how the message flows on wire and how system "B" reads it from the wire ?

View 4 Replies

C# - Application Page Not Working On Clients Computers

Jan 28, 2010

we developped an ASP.NET application that runs fine on our development server and in our network computers. But in production, the application works when accessing it directly from the web server but not on the clients (code behind is not executing).

View 5 Replies

Invalid Argument Javascript Error Only On Certain Computers?

Nov 18, 2010

Getting an error whenever we click a particular button/link on our site. It is generating a javascript "Invalid Argument" error. I know in the other posts it is typically because it is a syntax error in the javascript however it only just seems to have started happening and it doesn't happen on all pcs.

ie. in our client's environment if I remote onto their web server and view the uat website I get the javascript error. If I remote onto their sql server and view the uat website I don't get the javascript error. If it was a syntax error then I would always get the error wouldn't I?

both browsers are the same version of IE6 (yeah I know...) :) I have tried deleting temporary internet files - including viewing the files and deleting them myself - but no joy.

client uses citrix.. and they're all getting the error :(

Update - I haven't posted specific code as there is too much to post (and I'm not sure where the error is occurring). The "button" launches a new window which in turn opens up a couple of aspx pages and calls lots of javascript. So the window opens ok, and there's a function that gets called to resize the window - but before it calls the resizing of the window/content it throws the invalid argument error. Am busy trying to get alerts to trigger to see if I can see where it's falling over but so far no luck.

Again not sure why this error doesn't occur when I use a particular PC (same browser version)

View 3 Replies

Unable To Access Published Webpage From Other Computers?

Jan 18, 2010

I have published ASP.NET web site, using IIS7 on Win7. I can access this web site on my localhost, but it is inaccessable from other computers via internet. I have tried to disable firewall and anti-virus program, but with no success.

Does anyone know what may be causing this problem?

It works fine if I publish it on winXP.

View 4 Replies

Security :: Deny Same Login From Multiple Computers?

Jan 20, 2011

i am using form authentication in my web application.

by default, form authentication allow 2 different users to log in from 2 different computer using same username and password. due to which i am facing some problem.

when user 1 clicks on menu i am maintaining the name of selected menu in a session. but if another user clicks on different menu then the session variable is set to the menu selected by user 2. due to which the 1st user is facing some problem as the value in session got changed.

How can i overcome this problem? is there any way, where once the user has logged in, no one can log in with same username and password from another computer?

View 5 Replies

Security :: Deny Access To Webapplication To Specific Computers?

Mar 2, 2011

i have a web application which can be accessed via intenet the application is running on iis and configured using a router..i m looking for a good solution where i can give access to only authorized computers rest of the computers cannot access the applcation for eg:- if i have a users in office1 in sales dept. and he access the application from his office, so i want to deny the same user or any other user, that he cannot access the same application from home or antwhere else.

View 8 Replies

Inserting Records From Multiple Computers In The Same Database At The Same Time In SQL Server 2005?

Nov 12, 2010

I have a web portal designed in ASP.NET in which we ask customers to enter the data. On the click of submit button all i have done is, just read the data and called a stored procedure which inserts that into a table. There seems to be a problem in SQL Server 2005 while inserting the data from multiple computers at the same time. We have tested in our lab with three computers, result is that we get the data inserted successfully in only one machine and on the other two machines we get error on page. I have used transactions in the stored procedure and also tried setting the isolation levels to READ_UNCOMMITTED, SERIALIZABLE and SNAPSHOT. Nothing seems to work properly.

View 4 Replies

Visual Studio :: Opening A Project Across 2 Computers Running The Exact Same 2008

Feb 11, 2011

The problem is I have a laptop that I take to University with me to all my lessons and lectures and it has Visual Studio 2008 installed on it and I work on my assignments in Visual Studio just fine. However when I get home I would like to use my desktop PC which has the exact same copy even from the very same disk of Visual Studio 2008 that is installed on my laptop. The problem is no matter what I do I can't open and work with any projects that I have created on my laptop.

Now if I create the project on my desktop PC it will open just fine on my laptop and I can continue to work with the project but the minute I save and take that project over to my desktop I get the self same error message shown below. [URL] I did do a little research and I found what looked like a solution for some people and that was to change the "SQL Server Instance Name" to SQL2008. As shown below it was set to SQLEXPRESS which is the same as what it says on my laptop copy. [URL] But all this did was present me with a new message as shown below. [URL] Uploaded with [URL] I'm completely at a loss as to what the issue is. Both my laptop and desktop run a fully updated copy of Windows 7 64Bit and have the same copy from the same CD of Microsoft Visual Studio 2008.

View 13 Replies

Web Forms :: Attach The Image - Users Browse The File From The Local Computers And Send It

Feb 9, 2011

I have created a form and it works. But on the form I want to let users browse the file from the local computers and send it to us.

View 2 Replies

Visual Studio - What Is Best Option In Visual Studio 2010 To Sync Project Files Between Home & Work Computers

Feb 14, 2011

Im working on a website project with Visual Studio 2010 from 2 different computers (home & work).
In Dreamweaver Im used to FTP to upload/download files to/from a webserver to syncronice my files on the current computer Im working on.What is best option in Visual Studio 2010 to sync project files between home & work computers? I have seen there is a built in FTP, but seems only it can upload files, limited functionality?

View 1 Replies

Active Directory/LDAP :: How To Get A Liust Of The Properties Of The Computers In The Active Directory

Jul 13, 2010

Using C# how do i get a liust of the properties of the computers in the active directory.

I also need to know what is installed on each computer, is this something i can get through the active directory?

View 3 Replies

Code Reusability / Put The Code In One Class And Want To Inherit Same Code In Each Page?

Apr 12, 2010

Following is the code to insert userName from session and PageName into table to keep record that how many times a user does hit a particular page.

To avoid repitition of code I want to put the code in one class and want to inherit same code in each page.

How to get this task? Please do share with me? Here is the OK code:

[Code]....

View 17 Replies

C# - Invoking Server Code After Client Code For A Control INSIDE AJAX PANEL?

Jul 30, 2010

I've the Javascript code to do a confirmation before deletion of some records

function confirmDelete()
{
if(confirm('Delete all?'))
{
return true;
}
else
{
return false;
}
}

I've the button code here

<asp:Button ID="btnDelete" runat="server" onClientClick="return confirmDelete();" onClick="btnDelete_click" />

If i've the button outside an update panel (basically i'm using RadAjaxPanel by Telerik) it is working fine. But when the button is inside an ajax panel, even if i click OK for deleting the records the server side code is not called.

View 2 Replies

Visual Studio :: Missing Code Browser For Pages With Code Not In A Separate File?

May 1, 2010

I'm missing a the code browser when I create pages that have the code not placed in a seperate file. For pages with .asp.vb files I get the browser correctly.

I think it's called a code browser but just in case it's not I mean the dropdown that shows Page Events, Buttons and other controls that can be selected along with their events.

How do I turn on those dropdowns for pages with code behind that uses <script> tags in the actual .aspx page?

Included (Showing page events just under the tab):

Missing

View 1 Replies

Web Forms :: Call A Code Behind Function Form Html Source Code?

Mar 3, 2010

I want to call a function present in code behind from front page (html : source code)

i want to use like this:

Source code

<a href='<%# linkAlpha("B").ToString()) %>' title="B" id="B_List" runat = "server">B</a>

Code Behind

protected string linkAlpha(string value)
{
// /market-research/<%#Eval("customname")%>/
string str = "";
if (Request.Url.DnsSafeHost == "localhost")
{ // /market-reports/<%# Eval("customname")%>/
str = "Alpha_Category.aspx?q=" + value.ToString().Trim();
// Response.Redirect("Alpha_Category.aspx?q=" + value.ToString().Trim());
}
else
{
// str = "/market-reports/" + value.ToString().Trim() + "/";
str = "/Alpha_Category.aspx?q=" + value.ToString().Trim();
}
return str;
}

View 2 Replies

How To Call Code Behind Button Click Event Or A Code Behind Method From Javascript

May 18, 2010

how do you call code behind button click event or a code behind method
from javascript.

View 8 Replies

DataSource Controls :: Can The Select Command Of A SqlDataSource Be Given By Code In The Code Behind File

Apr 16, 2010

Can the select command of a SqlDataSource be given by code in the code behind file. Also by calling the SqlDataSource.Select can the select statement be executed?

View 3 Replies

Call Javascript Function From Code Behind After Server Side Code Executes

May 25, 2010

I have an asp.net button, that when clicked calls a code behind function. The function does some evaluation, and then I want to call javascript from within this asp.net function.

View 2 Replies

DataSource Controls :: Binding An ObjectDataSource To A Property In Aspx Code, Not Code-behind

Dec 3, 2010

I want to bind an ObjectDataSource to a property in my asp page and I want to do it in the page's aspx code, not in code-behind. I've already done it in code-behind, as follows:

[Code]....

I'd prefer to get rid of the ugly code-behind and just do this in mark-up. Something like
[Code]....

This gives me a run-time error: Cannot create an object of type 'System.Object' from its string representation 'SelectedBook' for the 'DataSource' property.Is there a way of doing this declaratively and not in code-behind? Further, what if what I want is to actually use a child property of the property in question? For example, if my Book object has a ReaderComments collection, can I databind to it decaratively in the aspx mark-up?

View 1 Replies

C# Sample Code Library Of Comon Tasks / Boiler Plate Code

Nov 12, 2010

anyone use/ know of any library or website with code snippets or samples with many of the mundane boilerplate code and/ or functions like data access, data scrubbing, recursive routines...

preferably c# since most of .net in the real world is c#. VB is ok too.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved