|
No. Because the Common Language Runtime needs to be there...plus all the base classes in the framework. So you have to ship the entire thing with your app.
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
This is a huge problem with .NET
If you're a small company and generally don't distribute your apps on CD, .NET is severly limiting your potential market.
I've managed to compile C++ 6.0 using Studio.NET and the final exe does not require the 22MB framework but I have been unsuccessful with VB.net
I agree that EVENTUALLY, everyone will have the framework installed, but untill then, would you download a 22.1MB application or a 100Kb application?
Rick Eastes.
http://www.eastes.net
|
|
|
|
|
I try to read the ActiveDirectory with DirectoryEntry an DirectoySearcher Class.
Can someon tell me how to read all Users of the ActiveDirectory.
|
|
|
|
|
When I do a webservice that has a soap element declared as int, the soap serialization attributed zero for it, if I don't pass him in the soap message.
Anybody knows how can I change the default value? Or avoid the serializtion attributed zero for the variable.
I was making my webservice in C#.
Thanks.
|
|
|
|
|
I use the code described below to one-way hash a supplied user's password to verify it against the one-way hashed password stored in a database.
While the code works and provides the functionality I am looking for I am not convinced that it does it in the quickest/most elegant/most sensible/safest way.
Any ideas for improvement?
char[] password = new char[50];
System.IO.StringReader reader = new System.IO.StringReader(this.textBoxPassword);
reader.Read(password, 0, 50);
byte[] bPassword = new byte[50];
for(int i = 0; i < 50; i++)
{
bPassword[i] = (byte)password[i]);
}
System.Security.Cryptography.SHA1 shaM = new System.Security.Cryptography.SHA1Managed();
byte[] hash = shaM.ComputeHash(bPassword);
char[] cHash = new char[hash.Length];
for(int i = 0; i < hash.Length; i++)
{
cHash[i] = (char)hash[i];
}
string hashword = new string(cHash);
|
|
|
|
|
I understand your pain.
There's a conceptual error here: you are assuming a byte is a char. This is only true in ASCII Encoding.
For the first for loop, check the System.Text.Encoding classes.
For the second for loop, I would use a Convert.ToBase64String to assure you'll not generate "weird" chars, although the resulting string will grow 33%.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
This is the way I'd do it:
System.Security.Cryptography.SHA1 shaM = new System.Security.Cryptography.SHA1Managed();
byte[] hash = shaM.ComputeHash(System.Text.UTF8Encoding.UTF8.GetBytes(bPassword));
string hashedPassword = System.Convert.ToBase64String(hash)
|
|
|
|
|
Is there a .NET equivalent to subclassing controls in a dialog box as on the Win32 side of things? I need a little more control over a textbox than the standard .NET API allows.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Create a new class inheriting from TextBox, add your functionality, then use that class on your Form.
Or use event handlers attached to a TextBox, but this is only good for having the TextBox do additional work, not change/stop the work it does.
James
- out of order -
|
|
|
|
|
Thanks. I've actually done that, but it does not represent a complete solution for what I am trying to achieve.
The form still owns the control and defines it's behavior. So, for example, even if I override the TextBox's OnPaint method and attempt to use the Graphics object to draw in the client area of the text box - the form's default behavior still overrides what I want the control to do.
The only way I am aware of to gain ownership of a control is to actually subclass it so that I can control its internal behavior - as commonly done in Win32.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Stan Shannon wrote:
The form still owns the control and defines it's behavior. So, for example, even if I override the TextBox's OnPaint method and attempt to use the Graphics object to draw in the client area of the text box - the form's default behavior still overrides what I want the control to do.
(I may not understand your situation right so this may not be what you are asking)
Then you need to override the Paint member inside your inhereted control.
e.g. In my CP+ app I did the following to provide a underlined look on DataGrid cells (this is C# but should be easy enough for other languages):
First I inhereted the DataGridTextBoxColumn (subclass I assume):
public class DataGridLinkColumn : DataGridTextBoxColumn
then I overrode the Paint event:
protected override void Paint(Graphics g,Rectangle Bounds,CurrencyManager Source,int RowNum, Brush BackBrush ,Brush ForeBrush ,bool AlignToRight)
{
g.FillRectangle(BackBrush, Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height);
FontStyle fstylNew = new FontStyle();
fstylNew = FontStyle.Underline;
System.Drawing.Font font = new Font(System.Drawing.FontFamily.GenericSansSerif , (float)8.25, fstylNew);
g.DrawString( GetColumnValueAtRow(Source, RowNum).ToString(), font ,Brushes.Blue ,Bounds.X ,Bounds.Y );
}
Is that what you are looking for?
Paul Watson Bluegrass Cape Town, South Africa Ray Cassick wrote: Well I am not female, not gay and I am not Paul Watson
|
|
|
|
|
Thanks, Paul. With the TextBox, even when "subclassed", the Paint event handler is never called. I assume this is because the parent class (in the windows sense) is processing the message via the parent Form.
I found a work-around, but to me this is just another example of why .NET is not yet an optimum development environment.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
You can override the WndProc function and intercept WM_PAINT. By overriding WndProc IMHO you should be able to do everything you could by Win32 subclassing.
Cheers
HTH
Martin
"Situation normal - all fu***d up"
Illuminatus!
|
|
|
|
|
Thats sort of what I was thinking also, I just wanted to hear someone else say it. I don't want to spend a lot of time right now going down that road only to run into more unexpected issues, but I might try it in the near future. Thanks.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
I want to catch the "SCROLL" events on a ListView control,
in order to code something like a dynamic populating ListView.
Someone knows about that?
|
|
|
|
|
You can use WndProc to catch messages if needed:
i.e.
protected override void WndProc( ref Message m )
{
if( m.Msg == 0x0114
|| m.Msg == 0x0115 )
{
}
base.WndProc( ref m );
}
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Thanks!!
It's nice.
|
|
|
|
|
When I create a .Net windows client that calls a .Net web service I can maintain session state on the web service as long I set the CookieContainer property to a new instance of a CookieContainer within the client side web service proxy.
Now, when the client of the web service is a .Net web site, I can't seem to maintain web service session state. I have made sure that the web service proxy and the CookieContainer have been persisted in a web site session variable, but every time the web site calls the web service, the web service sees a new session cookie and establishes a new session state.
Anyone having this same problem, or better yet solved it?
Thanks to anyone who responds.
|
|
|
|
|
...size. I'm just a beginner, but I'm trying to get the form to be maximised in the window. I now it's not to difficult, and I've even manage to do it some days ago, but I deleted the code and now I can't find out how I did it
Please help me...
Børge
|
|
|
|
|
Munti wrote:
but I'm trying to get the form to be maximised in the window
Use the Form.WindowState Property and set it to FormWindowState.Maximized
e.g. (from MSDN)
public void InitMyForm()
{
Label label1 = new Label();
label1.Location = new System.Drawing.Point(54, 128);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(220, 80);
label1.Text = "Start position information";
this.Controls.Add(label1);
WindowState = FormWindowState.Maximized;
label1.Text = "The form window is " + WindowState;
}
Paul Watson Bluegrass Cape Town, South Africa Ray Cassick wrote: Well I am not female, not gay and I am not Paul Watson
|
|
|
|
|
Excelent, worked perfectly
Thanks, Børge
|
|
|
|
|
None of my .NET apps, which run fine on XP, are running on W2K. I've loaded SP3, IE6, and DOTNETFX.EXE. I get "Application has generated an exception which could not be handled." BTW, these apps also run fine on my W2K machine on which I've already installed the dev environment.
No networking issues, etc.
Any ideas? I don't want to load the entire dev environment because I'm afraid then the problem will go away without my knowing why!
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator.
|
|
|
|
|
If you are using Data Access then MDAC 2.7 also needs to be installed.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Is it possible to serialize an Exception derived class? When I try to add an exception to a System.Messaging.Message object (which internally serializes the object to XML) I receive the following error:
System.InvalidOperationException: There was an error reflecting 'Send.DALException'. ---> System.InvalidOperationException: The property 'Source' on type 'System.Exception' cannot be serialized because it is decorated with declarative security permission attributes. Consider using imperative asserts or demands in the property accessors.
What does this mean? Can I get around it?
|
|
|
|
|
I'm giving a talk on GDI+ (which I know) and am looking for a comparison with DirectX.
Does anyone have any links or maybe some points for me to ponder on?
Cheers,
Simon
"VB.NET ... the STD of choice", me, internal company memo
|
|
|
|