|
Hi,
I am looking to get a list of users, specifically email addresses from an NT/2003 domain. Is there an easy way of doing this coz i have absolutely no idea how to approach the problem.
Thanks.
|
|
|
|
|
I'm implementing a background thread that updates the poistion of the Label control on a Form. I was told by Leppie that I was not correctly implementing the ISynchronizeInvoke interface. Can anyone tell me what I'm doing wrong ?
private delegate void ScrollThreadDelegate();
...
...
ScrollThread = new Thread(new ThreadStart(ScrollThreadFunction));
ScrollThread.IsBackground=true;
ScrollThread.Start();
...
private void ScrollThreadFunction()
{
while(RunScrollThread)
{
if(lbSongInfo.InvokeRequired)
{
this.lbSongInfo.Invoke(new ScrollThreadDelegate(this.ShowScrollText));
}
Thread.Sleep(50);
}
}
private void ShowScrollText()
{
if(lbSongInfo.Location==SongInfoEnd)
lbSongInfo.Location=SongInfoStart;
Point CurPos = new Point(lbSongInfo.Location.X,lbSongInfo.Location.Y);
CurPos.Offset(-1,0);
lbSongInfo.Location=CurPos;
}
|
|
|
|
|
Hi people,
I would be the happiest man on Earth if someone tells me how can I change the decimal symbol programmatically. I mean as my program starts i want to parse the strings in a way that the dot is always the decimal symbol no matter what regional settings are set on the PC.
Kamen Boyadjiev
|
|
|
|
|
You could get hold of a copy of a NumberFormatInfo object and modify the NumberDecimalSeparator to the desired character.
NumberFormatInfo nfi = Thread.CurrentThread.CurrentUICulture.NumberFormat.Clone();
nfi.NumberDecimalSeparator = ".";
string myFormattedDouble = myDouble.ToString(nfi); The above assumes the existance of a double called myDouble
Does this help?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Hi Colin,
thank you for your fast reply. This is really good idea but actually it does not help in my case. Actually I did not expressed my problem quite well. If I have a in a TextBox the string "1.2" I need to parse it as a 1.2 number and the problem is that when I have different decimal symbol not the dot I get quite astonishing numbers, such as for example 1200 by a german language settings due to that the dot is a digit grouping symbol . So my program must not take the german regional setting (if it is set so) but the english(united states) one.
Thank you in advance for any help
|
|
|
|
|
It is not too different from the code I provided above
CultureInfo ci = new CultureInfo("en-US");
NumberFormatInfo nfi = ci.NumberFormat;
double myParsedDouble = myDouble.Parse(txtMyTextBox.Text, nfi);
As the US English Culture already has the correct number format for parsing 1.2 as six fifths rather than 1200 you don't need to create a clone of NumberFormatInfo object and modify it.
Does this help?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Well Colin that sure would help. Really thank you for that help. Actually quite stupid from me that I have not noticed that to Parse could be passed a CultureInfo too. Really much obliged
|
|
|
|
|
Opps... Might have helped if I actually read into the System.Globalization namepsace first...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
1)when i use c# How can i take photo from my webcam ?
2)When i use c# What code do i have to write for entering button on the winamp?(For example i open the winamp program from C# and i want to use winamp program after i write the code in the c# i will enter the button it will play.)
|
|
|
|
|
I can't believe I can't make a panel transparent, I've spent a good couple of hours this morning, if I set the panel to transparent what seems to happen is the panel is drawn with the same color as the form which is ok, but if I have other stuff behind the panel that I want to show throught the panel, then I can't see those controls.
Any help is appretiated.
|
|
|
|
|
You have to set the panel order to background or drop the controls you want to show through in the panel.
|
|
|
|
|
I'm no expert in Oracle, but my first guess would be to remove the colons you put in the parameter names.
cmd.CommandText = "SELECT * FROM USERS WHERE USER_ID = pUserId"
cmd.Parameters.Add( new OracleParameter( "pUserId", OracleType.VarChar )).Value = "[USER_ID]" )
Putting "special" characters in an identifier is just not a good idea in any language.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi@all,
I would like to create a Vu-meter application in C# to display for any sound that goes to the sound card ,but I don't know how
Can anyone help me on how to capture the sound and make the app. work ?
code?
Thanx.
|
|
|
|
|
I'm relatively new to C#.
I need to find a way to convert a section of a byte[] to an double or convert to an int if required.
In C++ I would use the algorythms below but I don't know how to express this in a form that c# is happy with.
for an int
BYTE dBytes[4];
int ret = *(int*) dBytes;
for a double
BYTE dBytes[8];
int ret = *(int*) dBytes;
|
|
|
|
|
Check out System.BitConverter.
|
|
|
|
|
Brilliant, Thats exactly what I was looking for.
|
|
|
|
|
hi,
i want to do some device related application using C#(say for eg. TAPI).
Any article or books for this ???
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
You're going to have to be alot more specific about what your trying to do.
Define "device related" and what device?
C# and VB.NET are too high level for efficient device driver work...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
The best resource on TAPI and C# is here on GotDotNet[^]
IMO. TAPI and C# aren't a good mix. It just adds an extra layer of complexity. Unless you are well versed with TAPI, I'd say clear of trying to use it through C#.
Michael
CP Blog [^]
|
|
|
|
|
Is it possible to set the location of a main form within the screen to the same position every time the app is started?
The propertie Form.StartPosition seems to make little difference.
I read/write the forms size from the registry, but without controling it's start position it's only half a job.
|
|
|
|
|
Make sure you set the Form.StartPosition equal to FormStartPosition.Manual , then you can specify the Top and Left positions. Persist this value where ever you like (database, XML, config) and set properly at runtime.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks for the quick reply.
I found the Control.Bounds property and set this in the load event. Seems to work just fine.
|
|
|
|
|
Hello everybody!
My problem is to get/set individual array items which are instanced via reflection.
To give you an overwiew here´s some code:
***************************************************
System.Reflection.Assembly assembly;
assembly = System.Reflection.Assembly.LoadFrom(dllfilename);
foreach(Type assemblyType in assembly.GetTypes())
{
if (assemblyType.IsClass)
objInstance = Activator.CreateInstance(viptype);
foreach(FieldInfo f in objInstance.GetFields(BindingFlags.Public | BindingFlags.Instance))
{
if (f.FieldType.IsArray)
{
// read every array value!
// f.GetValue(objInstance) returns only a complete value (and I don´t know how to handle this)
// How can I access to every array item itself???
}
else
{
// do something different. This is working fine!
}
}
}
*************************************************
And the source from the assembly looks something like that (extremely shortened, but same structure):
************************
public class myClass
{
public int ID;
// Test
public int Test;
// Array
public int array[15];
}
************************
How can I get in the source at the top for example the 10th integer of the array?
Please help me
Norman-Timo
|
|
|
|