473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

From Login to username!

Oh! here comes Another problem I'm Not supposed to use Loginname
anymore I'm supposed to use username is there anyway I can Do it in
widows Authentic?
Thanks

Mar 26 '07 #1
14 2765
They're the same thing in every project I can recall. Are they different
things in your project?
Peter

"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
Oh! here comes Another problem I'm Not supposed to use Loginname
anymore I'm supposed to use username is there anyway I can Do it in
widows Authentic?
Thanks

Mar 26 '07 #2
Yes they are different in my project. if I loggin I caould use
something like ot002 But The Name would be Robert,Douglas.
Do you have an Idea.
Thanks.

Mar 26 '07 #3
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
Yes they are different in my project. if I loggin I caould use
something like ot002 But The Name would be Robert,Douglas.
Do you have an Idea.
You keep providing an extra little bit of information with every subsequent
post...

Are you saying now that you are using Windows Authentication and you need to
query Active Directory in order to retrieve the display name of the
currently logged-on user...?
Mar 26 '07 #4
No actually The Login name is not the name of the user. But they are
both registered onto windows. If one logs on and press on the start
button the name the name is displayed but the login name is different
And this time I want to display the name of the user not his login Id.
Hope you understand my situation.
Thanks.

Mar 26 '07 #5
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@b75g2000hsg.googlegr oups.com...
No actually The Login name is not the name of the user. But they are
both registered onto windows.
What does that actually mean...?
If one logs on and press on the start
button the name the name is displayed but the login name is different
And this time I want to display the name of the user not his login Id.
Hope you understand my situation.
Sorry - I don't...
Mar 26 '07 #6
On Mar 26, 4:23 pm, "rcoco" <nclau...@yahoo.cawrote:
Oh! here comes Another problem I'm Not supposed to use Loginname
anymore I'm supposed to use username is there anyway I can Do it in
widows Authentic?
Thanks
http://groups.google.com/group/micro...03fc4b8943fd13

Mar 26 '07 #7
Thanks Alexey,
I'm trying to put this code into c# I'm not so sure if it's wright.
the code in VB:
Dim DomainUser As String =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\",
"/")
Dim ADEntry As New
System.DirectoryServices.DirectoryEntry("WinNT://" & DomainUser)
Dim FullName As String = ADEntry.Properties("FullName").Value
And I'm changing it in C# like this:
String DomainUser =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\
\","/");
System.DirectoryServices.DirectoryEntry("WinNt://"& DomainUser);
String Fullname = ADEntry.Properties("FullName").Value;

But I'm getting these errors
1:'System.Security.Principal.WindowsIdentity.GetCu rrent()' denotes a
'method' which is not valid in the given context
2:Operator '&' cannot be applied to operands of type 'string' and
'string'
3:The type or namespace name 'ADEntry' could not be found (are you
missing a using directive or an assembly reference?)
Where I'm I going Wrong?
Thanks.



Mar 27 '07 #8
"rcoco" <nc******@yahoo.cawrote in message
news:11*********************@e65g2000hsc.googlegro ups.com...

So you *are* trying to query ActiveDirectory...sigh!
Thanks Alexey,
I'm trying to put this code into c# I'm not so sure if it's wright.
the code in VB:
Dim DomainUser As String =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\",
"/")
Dim ADEntry As New
System.DirectoryServices.DirectoryEntry("WinNT://" & DomainUser)
Dim FullName As String = ADEntry.Properties("FullName").Value
And I'm changing it in C# like this:
String DomainUser =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\
\","/");
System.DirectoryServices.DirectoryEntry("WinNt://"& DomainUser);
String Fullname = ADEntry.Properties("FullName").Value;

But I'm getting these errors
1:'System.Security.Principal.WindowsIdentity.GetCu rrent()' denotes a
'method' which is not valid in the given context
That's because you've omitted the parentheses:
System.Security.Principal.WindowsIdentity.GetCurre nt().Name.Replace("\\","/");
2:Operator '&' cannot be applied to operands of type 'string' and
'string'
That's because the string concatenation operator in C# is +, not &
System.DirectoryServices.DirectoryEntry("WinNT://" + DomainUser);
3:The type or namespace name 'ADEntry' could not be found (are you
missing a using directive or an assembly reference?)
That's because you've forgotten to actually instantiate the ADEntry
object...
DirectoryEntry ADEntry = new
System.DirectoryServices.DirectoryEntry("WinNT://" + DomainUser);
Mar 27 '07 #9
Thanks,
I've still gotten 2 errors:
1:The type or namespace name 'DirectoryEntry' could not be found (are
you missing a using directive or an assembly reference?)
On statement: DirectoryEntry ADEntry = new
System.DirectoryServices.DirectoryEntry("WintNT://"+DomainUser);

2:The type or namespace name 'ADEntry' could not be found (are you
missing a using directive or an assembly reference?)
On statement: string Fullname = ADEntry.Properties("FullName").Value;

What's wrong?
Thanks

Mar 27 '07 #10
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
What's wrong?
Have you forgotten to include the System.Directory namespace...?
Mar 27 '07 #11
at First yes but I've just add System. DirectoryServices;
And I still get an error this time it's:
The type or namespace name 'DirectoryServices' does not exist in the
class or namespace 'System' (are you missing an assembly reference?)

Mar 27 '07 #12
"rcoco" <nc******@yahoo.cawrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
at First yes but I've just add System. DirectoryServices;
And I still get an error this time it's:
The type or namespace name 'DirectoryServices' does not exist in the
class or namespace 'System' (are you missing an assembly reference?)
And what do you think that could possibly mean...?

In your Project explorer, right-click on References and set a reference to
the System.DirectoryServices assembly...
Mar 27 '07 #13
Thanks Mark,
But after that I got this error:
'System.DirectoryServices.DirectoryEntry.Propertie s' denotes a
'property' where a 'method' was expected
Thanks

Mar 27 '07 #14
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@p15g2000hsd.googlegr oups.com...
Thanks Mark,
But after that I got this error:
'System.DirectoryServices.DirectoryEntry.Propertie s' denotes a
'property' where a 'method' was expected
Hmm - we really are getting a long way in a long time this morning, aren't
we...

If this is your first C# project, you might want to familiarise yourself
with how it differs syntactically from VB.NET - it will save you a huge
amount of time...

Anyway, in C#, indexed property collections are referenced with square
brackets, not parentheses...

String Fullname = ADEntry.Properties["FullName"].Value;
Mar 27 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: |-|erc | last post by:
Hi! Small challenge for you. The index.php uses this file and calls layout(). Take a look at www.chatty.net this file draws the chat login box on the right. I traced the CHAT button it submits...
11
by: Ghazan Haider | last post by:
I am posting this for the lack of a better newsgroup, and for the knowledge of people here, and because its only partially OT. We have a bunch of users with their computers at work. There are...
1
by: Joe | last post by:
I have 3 servers server1: http://server1/login.asp, http://server1/page1.as server2: http://server2/login.asp, http://server2/page1.as server3: http://server3/login.asp, http://server3/page1.as ...
13
by: Neal | last post by:
I've got 2 tables. One, I manually insert data into for HTTP authentication. It has 3 fields: username, password, school. Once the user enters the corrrect u and p, the school name shows up hard...
1
by: EricRybarczyk | last post by:
I am starting a rewrite of an existing Classic ASP web site in ASP.NET 2.0. The existing ASP application has several types of users, each with a separate login process (separate login page,...
3
by: abeb | last post by:
Hi all, I recently given a task to upgrade a running server (PostgreSQL7.3+Apache2.0+PHP4.2) to a new server with PostgreSQL8.1+Apache2.2+PHP5.1 installed (all Fedora Core 6 packages). All is...
12
by: Fareast Adam | last post by:
I want to make sure all users those login are different in a time either on the same or different computer or web browser. Following are sample of my program which consist 4 different pages; ...
1
by: Tarcetial | last post by:
Im trying to make a personal website with a log in/registration system. I found some help with the log in and now i just need some help with the registration. This is the coding im already using: ...
0
by: kang jia | last post by:
hi i have small problems occurred in my login function, which i use Django to build, in my template which is login.html, the code is like the following: <html> <head>...
1
by: webandwe | last post by:
Hi, Can somebody please show me how to change the connection so I can make it work with my MYSQL database... I just need this login to work then I'm done wiht my project. I don't know what is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.