|
Hi all,
I am a Beginner to c#.
I Need to convert array of byte data type to string. How to do this..
ex:
byte[] bytes = new byte[1000];
this bytes get filled up. Now I need to convert to string.
How to do this..
|
|
|
|
|
Hello
You use the next code:
byte[] bytes = new byte[] { 0x41, 0x42, 0x43, 0x44, 0x45 };
string str = System.Text.Encoding.ASCII.GetString( bytes );
System.Diagnostics.Debug.WriteLine( str );
With best regards,
Andrew Kirillov, MCP x 3
Prize winner, August 2005
|
|
|
|
|
hi Kirillov,
Thanks a lot..
Worked and my problem is solved..
Have a nice day..
Shiva P
|
|
|
|
|
Can somebody point me to LDAP code for authenticating a user through LDAP or active directory.
Thanks in Advance.
Ramendra Kotharkar
Ramendra K
|
|
|
|
|
DirectoryEntry entry = new DirectoryEntry("LDAP://testdomain/DC=testdomain", "testdomain/" + textUser.Text, textPassword.Text);<br />
<br />
Object obj = entry.NativeObject;<br />
DirectorySearcher search = new DirectorySearcher(entry);<br />
search.Filter = "(SAMAccountName=" + textUser.Text + ")";<br />
search.PropertiesToLoad.Add("cn");<br />
SearchResult result = search.FindOne();<br />
<br />
if (null == result)<br />
{<br />
.<br />
.<br />
.<br />
}
This only works with AD, by the way: if you find that works with LDAP, please let me know
|
|
|
|
|
Hi
"%FrameworkSDKDir%\bin\resgen.exe" "$(ProjectDir)UserMessages.txt" "$(ProjectDir)UserMessages.resources"
I have added the above line in my post build event. It throws up a post build error.
(A tool returned an error code from the build event).
When i run the above command (replacing Project dir with directory path) from .net command prompt it works fine and returns the following message.
Read in 2 resources from 'c:\TestProject\UserMessages.txt'
Writing resource file... Done.
Thanks in advance.
|
|
|
|
|
Is there any wndows api or hook by which i can get application wide events in a windows application?
Please help me guys, i am stuck in a project.
Thanks in advance.
|
|
|
|
|
|
Hi
I was wondering if anyone could offer some advice on authenticating a .NET application with LDAP. The code seems to work fine with AD, but fails with LDAP. Also, I have a Java App that can do this just fine, but somehow the solution with .NET eludes me!
(extract)
DirectoryEntry entry = new DirectoryEntry("LDAP://testdomain/DC=testdomain", "testdomain/testuser", textPassword.Text);<br />
<br />
Object obj = entry.NativeObject;<br />
DirectorySearcher search = new DirectorySearcher(entry);<br />
search.Filter = "(SAMAccountName=testuser)";<br />
search.PropertiesToLoad.Add("cn");<br />
SearchResult result = search.FindOne();<br />
<br />
if (null == result)<br />
{<br />
.<br />
.<br />
.<br />
}
The test PC runs on a Windows XP box with .NET Framework 1.1, and is bound to whichever server we're testing on at the time.
The authentication server is a Mac OS X 10.4 server running LDAPv3 (I believe built on OpenLDAP, and should be similar in every way).
Any suggestions?
(or anyone with a Linux OpenLDAP domain out there?)
|
|
|
|
|
|
Thanks - have you perhaps got a link to it?
|
|
|
|
|
|
how to add an event 2 a graphics object?
|
|
|
|
|
Can you post an example of the code you are wishing to "add an event" for so we can see what it is yo're trying to do?
|
|
|
|
|
How do i get Application wide events in a windows application?
Thanks in advance.
|
|
|
|
|
We need to know a little bit more about what you are trying to do. You can create class specific events using event delegates. Is this what you are lookign for? If so, I'll post you some examples. If not, please elaborate on what it is you're trying to do.
|
|
|
|
|
Hi
How can I retrieve the terminal session id?
My code is as follows:
[DllImport ("User32.lib", CharSet = CharSet.Auto)]
private static extern Boolean GetSystemMetrics(int nIndex);
[DllImport ("Kernel32.lib", CharSet = CharSet.Auto)]
private static extern uint WTSGetActiveConsoleSessionId();
public static Boolean IsRemoteSession()
{
return GetSystemMetrics( SM_REMOTESESSION );
// Where can I get this SM_REMOTESESSION from?
}
public static uint GetSessionId()
{
return WTSGetActiveConsoleSessionId();
}
|
|
|
|
|
Hi!
Usually the easiest way to get the real definition for constants like SM_REMOTESESSION is to search through the header files in the platform sdk.
You can use VS.NET's search in files dialog:
search [VS.NET Installation Path]\Vc7\PlatformSDK\Include (including subdirectories) for *.h files containing the symbol and you'll find the definition.
In your case, it's defined in WinUser.h and its value is 0x1000.
Regards,
mav
|
|
|
|
|
Hi
Thanks. Then where can I get a list of functions in the wtsapi32.dll?
|
|
|
|
|
You can use DependencyWalker (http://www.dependencywalker.com/[^]) to get the function names in dlls, but without a description of what the functions do and which parameters they expect you won't get very far.
So the better choice is to read the documentation on MSDN.
Regards,
mav
|
|
|
|
|
|
Do anyone have any website, notes or links on .NET WebApplication using C# ??
Topics about how to create forms using .NET Web Application, just like a user interface retrieving data from the database...Or anyone can post me the past examples or folders you have done using C# Webapplication??
Thankz alot... Your help is been appreciated..
Cheese_kid =p
|
|
|
|
|
What you really want is ASP.NET. There's a bazillion examples and tutorials out there. You may want to start at http://www.asp.net[^]
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
Are you sure you mean bazillion and not brazillion[^]?
SCNR
mav
|
|
|
|
|
HI,
I am working in crystal reports XI. In this I have to code in C# such that , it have to load a image at run time in crystal ReportXI .
I searched a lot in net but couldnt do the thing which i want to do.
I found that Dyanmic image location in crystal reprot XI , a advantage in
CR-XI.
But I dont know how to do this ... In the future I willbe working with many application based on this concept.
so please any one explain how to do .
or send the coding part ....
j s
-- modified at 1:07 Friday 7th October, 2005
|
|
|
|