|
So what i need to do is apply the SeDenyInteractiveLogonRight right to the account.
Does anyone know how to do this in C#? (preferably using DirectoryEntry)
Thanks again
ccitt
|
|
|
|
|
hi
i want to change color of some words in my richTextBox, and i write this code :
string str = this.richTextBox1.Text;<br />
char[] ch = new char[] { ' ' };<br />
int num = 0;<br />
foreach (string s in str.Split(ch))<br />
{<br />
if (s == "that")<br />
{<br />
int indexStart = this.richTextBox1.Text.IndexOf(s);<br />
this.richTextBox1.Select(indexStart, s.Length);<br />
this.richTextBox1.SelectionColor = Color.Red;<br />
num++;<br />
}<br />
}<br />
this.textBox2.Text = num.ToString();
but only change color of the first word that found, and not change color of all words that found, what is my problem and how to solve it ?
thanks
|
|
|
|
|
It's because you're finding the index of the first instance. Use one of the overloads of String.IndexOf[^] to specify a starting index that does not include the last found item.
|
|
|
|
|
Hey everyone,
I have a dataset which stores the results of a query that retrieves information from three tables . The thing is i bound it to a binding navigator and now i want to display the fields in text boxes or labels . My problem is, i dont know how to bind the navigator to the text boxes. The navigor has information in it, 3 records to be exact which was returned from my query, but now i dont know how to view it in a series of text boxes .
This is a code sample:
where bs is my binding source,
bngLoop is my binding Navigator,
and ds is my data set;
{
ds.Load(read, LoadOption.OverwriteChanges,
new string[{ "Result" });
bs.DataMember = "Result";
bs.DataSource = ds;
bngLoop.BindingSource = bs;
txtName.DataBindings.Add(new Binding("Text", bs, "Result.Client_Name", false));
}
i keep on getting this error:
DataMember Property 'Result' cannot be found on the DataSource.
Please help me
Phoenix
Phoenix
|
|
|
|
|
Hi,
I have a propertyholding object, that I use a PropertyGrid to view and edit.
The property I am having problems with is of type TimeSpan.
When the property is displayed in the PropertyGrid, it is done in the format hh:mm:ss, and nothing I do can convince the Grid, that I should be allowed to enter TimeSpans greater than 23:59:59!
If I programmatically enter a greater value and then bind to the grid, it correctly displays the value and even lets me edit it...
Please help out poor, simple noob!
Here's the (pseudo-)code of the object, I pass to the PropertyGrid:
public class PropertyHolder
{
Private TimeSpan _Duration;
PropertyHolder(){}
[...]
Using System;
Using System.ComponentModel;
[CategoryAttribute("Base Properties"), Browsable(true),
BindableAttribute(false), DescriptionAttribute("The time this Activity is planned to take.")]
public TimeSpan Duration
{
get { return _Duration; }
set { _Duration = (TimeSpan)value; }
}
}
Sincerely
Michael Barner
|
|
|
|
|
Hello Michael,
from what I can read in the docs, the format that will be understood when Parse is called is [-][d.]hh:mm:ss[.ff]
Anyway this is a very good case candidate for the new Smart FieldPackEditor component. I will allow edition of time durations in an intuitive manner.
|
|
|
|
|
I am coding a "Trace" object. This object will report the "method name" of the method within the class that the code is currently executing. I do not want to have to type in the method name each time the trace object is called. I simply want to be able to pass my object some sort of reflections.method.name.Tostring() call. This methodology can then be transported everywhere in all the methods without having to worry about misspelling or renaming the method down the road.
Eric "Moose Man"
|
|
|
|
|
eunderwo00 wrote: I am coding a "Trace" object
"Well done"
|
|
|
|
|
Jon Hulatt wrote: using System.Beer
Right now on my desk,
using System.Beer.Becks;
|
|
|
|
|
|
hi,
i'm looking fo a way to enable/disable my network connetion, via code.
after toggling, is there a way to know that i reached the wanted status? is there event i can catch to know if i'm connected/disconnected?
thanks.
|
|
|
|
|
|
hi,
i saw this link, but as i asked before - i wolud like to that in c#. any ideas?
thanks
|
|
|
|
|
Hey guys, I'm having a problem double buffering my control.
The control requires the UserPaint flag set to false, so I manually paint the control. Now since the control is painted over and over again I experience some flickering problems. What is the best way to create a custom like double buffer which prevents my control from flickering? The OptimizedDoubleBuffer style does not work when UserPaint is set to false.
<br />
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);<br />
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);<br />
this.SetStyle(ControlStyles.Selectable, false);<br />
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);<br />
this.SetStyle(ControlStyles.UserPaint, false);<br />
|
|
|
|
|
|
Hi,
Does anyone know whether it is possible to write managed code that utilised the L1 and L2 cache? The reason I'm asking is because it is faster to access the L1 and L2 cache.
Thanks
kk
|
|
|
|
|
The most recently used data and code are stored in the cache automatically, and only swapped out to main memory when something else needs the space. You don't need to do anything special to make this work. For computationally intensive code you want to try and keep your working set of data and the hot loop of your code small enough to fit into the cache if possible, but these days that's almost never needed unless you're doing scientific computing in which case you should probably be using C++ to begin with so you can ultimately rewrite the innermost sections of the hot loop in assembler This ofc assumes you are or have the skills of a good assembler programmer available, an average coder is probably going to be out performed by the compiler now.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Hi Dan,
Thanks for replying. I'm actually involved in high performance computing. I've read an article on whether CLI-based virtual machine is suitable for high performance computing and the conclusion is it is possible. Code becomes more efficient as JIT compiler progresses from one version to a new version. I believe Java Grande has also proven that Java is suitable for high performance computing.
Regards,
kk
|
|
|
|
|
Has anyone got crystal to work with MySQL and VS 2005?
I've tried connecting via ODBC and everytime i touch the database expert VS encounters problems and has to close. I've had a really good search on Google and can't find any pointers as to how to get these things to work.
If anyone's got a website that might help me i'd be really grateful,
Thanks in advance,
Russell
|
|
|
|
|
|
|
Hi,
I want to search a specific string in .txt file and copy that string in to another file. How can i do this in C#?
|
|
|
|
|
Try this out:
StreamReader reader = new StreamReader("c:\\test.txt");
String line = "";
while(line != null)
{
line = reader.ReadLine();
if(line.IndexOf("is line two") != -1)
{
StreamWriter writer = new StreamWriter("c:\\testOut.txt");
writer.Write("found!");
writer.Close();
break;
}
}
|
|
|
|
|
Hi everyone,
I just wanna know how do u compare a password with the one given in the login form when its been encrypted with MD5 technique. How can u check that the user has entered correct password.
thanks
Rocky
|
|
|
|
|
Rocky71 wrote: I just wanna know how do u compare a password with the one given in the login form when its been encrypted with MD5 technique. How can u check that the user has entered correct password.
By encrypting (or, to be accurate, hashing) the password that the user typed in then comparing the two MD5 hash values.
|
|
|
|