|
Is there a way to do this? I tried setting the PasswordChar of the textbox contained in my datagrid, but that only masks the text when that textbox is selected. If you click away from the textbox the masked text is revealed again. I'm binding to an array of MyClass objects contained within another object.
Here's my code:
<br />
dgServers.SetDataBinding(myClassCollection,"MyArray");<br />
DataGridTableStyle myTS = new DataGridTableStyle();<br />
myTS.MappingName = "MyClass[]";<br />
DataGridTextBoxColumn myCS = new DataGridTextBoxColumn();<br />
myCS.MappingName = "Password";<br />
myCS.Width = 500;<br />
myCS.TextBox.Multiline = false;<br />
myCS.TextBox.PasswordChar = '*';<br />
myTS.GridColumnStyles.Add(myCS);<br />
dgServers.TableStyles.Add(myTS);<br />
What do I need to override to get this to work?
Thanks
|
|
|
|
|
Okay, I worked this out with a little help from somewhere else. What you need to do is create a new class that derives from DataGridTextBoxColumn and override the Paint method. Here's what I did in case anybody else needs to do this:
public class PWColumn : DataGridTextBoxColumn
{
protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight)
{
MyClass thisObj = (MyClass) source.Current;
string orig = thisObj.Password;
orig = Regex.Replace(orig,".","*");
this.PaintText(g,bounds,orig,alignToRight);
}
}
|
|
|
|
|
can any dll written and compiled in vb.net, c++.net, or j#.net be used unconditionally in a c# project?
|
|
|
|
|
|
Hi all,
I have to detag an HTML page. So I used the pattern
string pattern = @"(?i)<script([^>])*>(\w|\W)*])*>|(?<gt>(<(""[^""]""|'[^']'|[^>])+)?>)";
string strParsed = Regex.Replace(contenuHtml, pattern, " ");
with this I got text with some malicious code like ".maillink{color:white;text-decoration:none;}" and so on.
For exple having HHHHfunction(){ffff}je suis néo en C#jksfjksdfjkfkfj I would like to obtain the contain of the body "je suis néo en C#jksfjksdfjkfkfj" and trashing all scripts, css, links and so on.
Some one can help me giving to me the correct pattern for the Regex.Replace(....)?
Thanx very much
TT
|
|
|
|
|
I may be a little confused by why not just do something like this
int nStart = contenuHtml.IndexOf("");
int nEnd = contenuHtml.IndexOf("");
string strBody = contenuHtml.SubString(nStart+5, nEnd);
|
|
|
|
|
With this solution I cannot clean malicious code like tags options, some cascade style sheet options. Fro exple:
nnnnnnn
I would try to integrate your solution in my code and I hope it should run.
Thanx
|
|
|
|
|
What's the difference between:
1. "RequestOptional" and "PermitOnly"
2. "Demand" and "RequestMinimum"
|
|
|
|
|
how can i pass a parameter to a thread??
Thread thread = new Thread(new ThreadStart(threadFeed(feed)));
you see; I need to send the array "feed" to the method "threadFeed", but I it won't allow me.
I asked a friend and he said you couldn't pass parameters to threads...
If you can't pass parameters, how is the thread sopposed to get any outside information????
/\ |_ E X E GG
|
|
|
|
|
I know... that can be a pain. Put it in a variable that's reachable from the threadFeed method, and have the threadFeed method read it from there.
|
|
|
|
|
wow i posted that about 10 seconds ago...
damn... and I was really psyched about multi threading too. This sucks...
/\ |_ E X E GG
|
|
|
|
|
You do know that only the starting method is the only
one that can not take parameters.
|
|
|
|
|
i know... but that's the only one I care about... ideas?
/\ |_ E X E GG
|
|
|
|
|
|
Create a class to hold your parameters and that class has the method you want the new thread to start running & pass the instance method as the constructor parm to your thread.
ex:
class MyThreadWorker
{
public string MyParm;
public void MyMethod(void)
{
// Do stuff w/ MyParm
}
}
...
MyThreadWorker w = new MyThreadWorker()
w.MyParm = "WooHoo";
Thread thread = new Thread(new ThreadStart(w.MyMethod));
...
|
|
|
|
|
Thanks for you help.....
uh... it wasn't working for a while, until I realized there was no thread.Start()....
anyways, it works now. thanks.
/\ |_ E X E GG
|
|
|
|
|
|
Got a project on hand, but they need to implement to the Win32 DLL in order
for the call from the framework. Is it possible or means that I have to
switch to VC++. Nightmire if have to do that.
|
|
|
|
|
No, C# project cannot be compiled to a Win32 DLL. You may build a .NET component, then wrap that within a COM Callable Wrapper, but that would still require .NET run-time to run.
|
|
|
|
|
|
i used WMI to get disk c and set disk["VolumeName"] but it's not working???
help me
|
|
|
|
|
Help Me!!!!
SOS
|
|
|
|
|
I found a solution
see http://www.dotnet247.com/247reference/msgs/24/122501.aspx
string VolumeName= disk.Properties["Volumename"].Value.ToString();
disk.Properties["Volumename"].Value = "Happy_4th";
PutOptions poptions = new PutOptions();
poptions.Type = PutType.UpdateOnly;
poptions.UseAmendedQualifiers = true;
disk.Put(poptions);
|
|
|
|
|
AFTER my application comes up, if there is no file stored in the registry, it needs to popup a dialog asking if the user wants to search for a file to open, create one or exit.
I can't figure out where to put this dialog. I tried in OnActivated, but I can't close the application from there (unless I'm doing it wrong, which wouldn't surprise me.)
NOTE: THE APPLICATION MAIN FORM MUST ALREADY BE DISPLAYED!
Any help would be greatly appreciated.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
if (OpenFileDialog.Show() == DialogResult.Yes)
Applcation.Run( new MainForm(OpenFileDialog.Filename));
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|