FileStream & MapViewOfFile comparison
I need to access big data in a readonly fashion.
I was thinking to open a FileStream and seek and read as needed.
I was wondering if it was worth doing my own FileStream class which would
use internally use MapViewOfFile internally?
Or pehaps a purely managed wrapper which, at least, load the bytes in 4k
memory buffer (and update the buffer everytime I move)? Tag: service pack ? Tag: 118582
Escaping backslashes in XPath (C#)
I have an XML file which have nodes that contain filepaths,
e.g.<path>c:\SomeDirectory\SomeFile.txt</path>
I'm using an XmlDocument and XPath query to try and find a node
XmlDocument doc = new XmlDocument();
doc.LoadXml(File.ReadAllText(xmlFilePath));
string somePath = @"c:\SomeDirectory\SomeFile.txt";
string query = "node1/node2[Path='" + somePath + "']";
XmlNodeList nodes = doc.SelectNodes(query);
The problem is, query becomes
"node1/node2[Path='c:\\SomeDirectory\\SomeFile.txt']" (Note the double quotes
due to the escaping of the backslashes). Obviously this doesn't match the XML
node in question. How do I work around this? (I don't want to use double
backslashes in the XML file.) Tag: service pack ? Tag: 118581
.Net framework and VB
Hi,
I have recently started coding and designing the ,.NET based system
using different technology involved in .NET and well from the subject
line of this post, it is obvious that I am coming from a VB background.
I have many years of expirance in designing distributed system based on
VB, C++ and SQL Server but when I have tried .NET it is a complete new
exerince for me and I am not hesitant in saying this is a damm cool
stuff from MS.
Now in this regards, I got a question but I am really not sure what is
the case in .NET.
In earlier days, when I used to design classes based on limited VB
object based model, we used to create 2 different callses for one
business component. One class which is used for all database read
operation and another for database write, update and delete opeation.
Now, why we were doing this so because of the locking in database via
VB programs. if all database select operation id seperated from
database write operation it palces less locks and almost comes out
immediatly by removing database locks (Offcorse when all the VB dlls
are regirsted in COM+). Now I wanted know is this still applicable in
.NET.
For example, if I want to write a Cusomter business component, do I
still have to seperate out the select and updates in seperate classes.
In earlier days, I used to designed a dll with following classes.
CustomerRead (Main class to read, exposed to world)
CustomerWrite (Main class to write, exposed to world)
CustomerSingleSelect - a calss which gets data from customer based on
primary key and always return me a sigle row
CustomerMultiSelect - a class which gets the data from customer where
select operation is not based on its primay key.
CustomerModify - a class to modify customer.
Belive me this approch was much faster then everything in one class.
But this was the case in VB time. Does this still a case in .NET?
Thanks & Regards,
pb Tag: service pack ? Tag: 118571
Framework 2.0CD vs WU Redistributable
Hello everyone,
I recently ordered the CD's for 1.1 and 2.0 to avoid the long download time.
I"m only using them to run apps that require them, no program development in
mind. The 1.1 is the same size as is offered on WU, but the 2.0 on CD is
87.59MB vs WU at 22.4. Does anyone know what the difference would be? I've
been all over the site but can"t find this info.
--
Thanks,
PattiR
Windows XP Sp2
IE 6.0
AOL 9.0 SE Tag: service pack ? Tag: 118570
squishyTree component ASP.NET 1.1
Hi all,
I have just a little problem to solve.. I have to add tooltip to nodes
of my tree. Any help?
Thanks in advance. Tag: service pack ? Tag: 118568
Casting IEnumerable<T> to IEnumerable<V>
Suppose a collection class defined as:
public class Friends: ReadOnlyCollection<Friend> {}
where Friend implements IPerson:
public class Friend:IPerson {}
My question: is there a neat+lean way to implement IEnumerable<Person>
in the collection class?:
public class Friends: ReadOnlyCollection<Friend>, IEnumerable<Person>
{
public new IEnumerator<Person> GetEnumerator()
{
// ******* CAST DOES NOT WORK **********
return (IEnumerator < IVSelItem >) base.GetEnumerator();
}
}
Any suggestions?
Thanks in advance. Tag: service pack ? Tag: 118567
Creating extra classes
I recently upgraded from VS 2003 to VS 2005. In VS 2003 all I had to do to
make an extra class was put the following in a *.vb file:
Imports System.Web.UI
Imports System.Web.UI.WebControls
Public Class MiscExtras
Public Shared Sub AddRollover(ByVal img As Web.UI.WebControls.Image,
ByVal rollover As String)
'Adds the rollover feature to an Image or ImageButton (or other
class that inherits from an Image)
img.Attributes.Add("onmouseover", "this.src='" & rollover & "';")
img.Attributes.Add("onmouseout", "this.src='" & img.ImageUrl & "';")
End Sub
End Class
And then to access it from a file in the same I would use the following:
MiscExtras.AddRollover(imgHomeButton,
"images/MenuBarButtons/HomeRollover.gif")
However, when I try to do this in Visual Studio .NET 2005 I get the error
'Name MiscExtras is not declared.'. I also tried putting the file in the
App_Data directory that is automatically created, but it did not make any
difference. What am I doing wrong? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/ Tag: service pack ? Tag: 118555
ImageAttributes isn't working
Hello,
For some reason this ImageAttributes isn't doing what I tell it. I'm
not sure what I am missing. I am trying to get background of the image
to display as transparent. But it draws the image unchanged. Here's
my code.
Dim ImgColorMap(0) As System.Drawing.Imaging.ColorMap
Dim BackColor As Color
'Draw the Background
graph.DrawImage(BackGroundImage, 0, 0)
'Draw the board
BackColor = BoardImages(0).GetPixel(0, 0)
ImgColorMap(0) = New System.Drawing.Imaging.ColorMap
ImgColorMap(0).OldColor = New Color
ImgColorMap(0).OldColor.FromArgb(BackColor.A, BackColor.R,
BackColor.G, BackColor.B)
ImgColorMap(0).NewColor = New Color
ImgColorMap(0).NewColor.FromArgb(0, 0, BackColor.G, 0)
BoardImageAttributes = New
System.Drawing.Imaging.ImageAttributes
BoardImageAttributes.SetRemapTable(ImgColorMap)
graph.DrawImage(BoardImages(0), New Rectangle(50, 50, 50, 50),
28, 28, 50, 50, GraphicsUnit.Pixel, BoardImageAttributes) Tag: service pack ? Tag: 118549
Convert to Long from Double that is over 18 digit long from Oracle
This is a serious bug in .NET 1.1
Using SQL select one field from Oracle table,
This column Oracle data type is: Number(18),
the field value is: 235312035283022003
which is the correct value.
However, using DataReader,
(We want the end result is long type, the only way is GetDouble(reader,0))
Here is the horrible result .NET Returns:
long viewId = 0;//We want the end result is long type,
double dViewId = reader.GetDouble(0);
viewId = (long)dViewId; // we get 235312035283022016
string sViewId = dViewId.ToString("R");//we get "2.35312035283022E+17"
sViewId = dViewId.ToString("F0");//we get 235312035283022000
viewId = long.Parse(sViewId);//235312035283022000
No matter what, we cannot get the correct value:
235312035283022003
This bug happenend when double value reaching 18 digit long.
It is fine when under 17 digit.
Any known work around?
How Microsoft proved .NET is able to be mission-critical?
We are a leading Telecom company, currently reaching the buggy-threshold in
our billing system due to this bug. Any help are appreciated.
Thanks.
Jordan Tag: service pack ? Tag: 118547
mail failed
hi,everybody
I use dotnet 2005 and c sharp to deliever a mail to a certain mail
address,but it failed with messages such as "invalid parameter,the server
response: decode failed". My codes is listed belowed:
try
{
MailMessage mailObj = new MailMessage();
mailObj.To.Add("wuhuanfa@hotmail.com");
mailObj.From = new MailAddress(crespo1973@21cn.com);
mailObj.Subject = "Óʼþ²âÊÔ";
mailObj.Body = "ºÍѶÓʼþ½ÓÊÕ²âÊԳɹ¦! ";
mailObj.IsBodyHtml = true;
mailObj.Priority = MailPriority.High;
mailObj.BodyEncoding = System.Text.Encoding.UTF8;
System.Net.Mail.SmtpClient client = new
System.Net.Mail.SmtpClient("smtp.21cn.com");
client.UseDefaultCredentials = false;
client.Credentials = new
System.Net.NetworkCredential("crespo1973@21cn.com",
this.tb_mailUserPassword.Text);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(mailObj);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return;
}
crespo1973@21cn.com is a correct account of mail.21cn.com,Could anyone
help me?
Crespo
2006-06-30 Tag: service pack ? Tag: 118541
How to specify KEY_WOW64_64KEY in the .NET framewor?
Hi,
I want to use 64bit hive from 32bit application. i am using Registry*
classes of .NET framework to get the informtion.
I don't know how to specify KEY_WOW64_64KEY flag while accessing the
64bit hive.
Any help?
Thanks in advance.
Mahesh Tag: service pack ? Tag: 118537
ASP.NET: VSNET2003 to VSNET2005
I just upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005.
There are several questions I have about the code differences between them
(I use VB.NET for as my language of choice):
1. 2003 used "Public Class classname" and 2005 uses "Partial Class
classname". What, if any, difference is there between these?
2. The following things are included in the #Region " Web Form Designer
Generated Code " part of 2003's code, and are not included automatically in
2005:
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Control declarations, such as:
Protected WithEvents lblWebsite As System.Web.UI.WebControls.Label
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
InitializeComponent()
End Sub
Do I need to include any of these manually or anything else that serves
their purpose?
3. In 2003 the Page Events use clauses such as Handles MyBase.Load while
2005 uses Handles Me.Load. I am assuming that these will work the same?
I am sure that I will run into the other differences between the two, but
these are some of the important ones for me right now. Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/ Tag: service pack ? Tag: 118528
Global.asax.vb in Visual Studio .NET 2005
I recently upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005.
Visual Studio .NET 2005 does not create the Global.asax files that Visual
Studio .NET 2003 did, which I used for variables such as the location of my
database. What is the conventional way of creating global variables for
purposes like this in Visual Studio .NET 2005? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/ Tag: service pack ? Tag: 118527
Framework 1.1 Problem
Hi All,
I do not know what happened to my machine but any program I try and run I
get the following:
An unhandled exception of type 'System.NullReferenceException' occurred in
Unknown Module.
Additional information: Object reference not set to an instance of an
object.
However, if I try and re-install Framework 1.1 SP1 and then run the program
it works fine. However if I reboot the machine I get the same error and need
to re-install Framework 1.1 SP1 to get rid of the error.
I hate having to do this every reboot, so can someone shed some light.
Thanks
Steve Tag: service pack ? Tag: 118526
Framework 1.1 Problem
Hi All,
I do not know what happened to my machine but any program I try and run I
get the following:
An unhandled exception of type 'System.NullReferenceException' occurred in
Unknown Module.
Additional information: Object reference not set to an instance of an
object.
However, if I try and re-install Framework 1.1 SP1 and then run the program
it works fine. However if I reboot the machine I get the same error and need
to re-install Framework 1.1 SP1 to get rid of the error.
I hate having to do this every reboot, so can someone shed some light.
Thanks
Steve Tag: service pack ? Tag: 118525
Opening projects from VS 2003 in VS 2005
I recently upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005.
I have several projects that I created in Visual Studio .NET 2003, but when
I try to open them in Visual Studio .NET 2005 it tries to force me to
convert them. for some of these it would be fine, but some of them run on
servers that do not support .NET 2.0 yet, I simply want to edit the code
remotely but not convert anything. How can I prevent Visual Studio .NET 2005
from forcing me to convert the files? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/ Tag: service pack ? Tag: 118519
How to Stop a Listening socket?
I'm trying to make a simple little asynchronous socket server. It accepts
connections, reads and writes, but I can't make it gracefully stop listening.
listener.listen(1)
listener.beginaccept(...)
If before anyone has attempted to connect, I try to stop the listener
socket, I get nasty errors, which I can trap, but it is not obvious that it
has actually stopped or that the asynchronous callback system has been
aborted. This should be trivial. What am I missing? Tag: service pack ? Tag: 118518
Now I need to do this without breaking ASP.Net
I've been struggling for two weeks now to duplicate a VB6 ActiveX control in
VB.Net, and also improve it's functionality. The control is used to collect
the user's fingerprint and compare it to a stored copy on the server, and if
the match is successful fill some hidden fields with values and call a form
submit. We wanted to use web services rather than direct SQL connections as
we do now, and to also have the web service URL set dynamically.
We built the project as a Windows Control (DLL) class with COM Class and COM
Visible set to True. We were able to get the control to load in IE, but due
to the need to interface with the local USB fingerprint device we had to
list the web site as Trusted and elevate the Trusted Zone to perform no
security checks (Problem #1).
The class required a couple of DLL files to function properly, and as
expected we were able to put them in the same folder as the class DLL file
and they were downloaded automatically. The problem was the App.Config
file, it never would download. (Problem #2) We recently figured out that
apparently a DLL can't make use of App.Config, but the calling app can.
This explained seeing the client attempt to download iexplore.exe.config in
the web logs. To make matters worse, it wasn't attempting to download the
file from the location of the class DLL, but rather from the root of the web
site and from /bin folder. (Problem #3)
So we renamed the App.Config file and placed it in the root. It still would
not download, this time with 403 Errors which we determined were the ASP.Net
interpreter trying to process the file rather than allow direct access.
(Problem #4) We decided to remove the parsing of .config files from the
configuration of the root web app, which finally allowed everything to
execute properly. But now, if we had any web.config files in the root app,
they would be open to being freely downloaded, and might not even work at
all (Problem #5)
I just know there has to be a better way to do this. I cannot believe that
it's this difficult with .Net to duplicate and improve on the functionality
we had using VB6. Perhaps someone with experience in things such as this
will step forward and point us in another direction.
Thanks,
Patrick Bates Tag: service pack ? Tag: 118516
RSACryptoServiceProvider.VerifyData Hangs
I have found that RSACryptoServiceProvider.VerifyData sometimes hangs for
several (typically 6 or more) seconds. This is very irritating since a
component that I am using makes this call every time a form in my
application opens. The entire application freezes. Obviously it makes my
application very sluggish.
Mind you, on some machines the above always seems to be very quick. And on
others it can be quick for several minutes, and then start hanging for a
while.
I'm using .Net Framework 2.0. Here is some sample code from my very basic
"hello world" application, followed by the trace output (generated using
Enterprise Library)...
public static void Trace(string message)
{
Logger.Write(message, "Trace", 0, 0,
TraceEventType.Information);
}
private RSACryptoServiceProvider encryptionService = new
RSACryptoServiceProvider();
private string publicKey = [I have an approximately 340 character
xml formatted string here]
private string xmlData = [I have an approximately 470 character xml
formatted string here]
private string Signature = [I have an approximately 200 character
base 64 encoded string here]
private void button1_Click(object sender, EventArgs e)
{
Trace("Before encryptionService.FromXmlString");
encryptionService.FromXmlString(publicKey);
Trace("After
LicenseProviderBase.EncryptionService.FromXmlString");
Trace("Before encryptionService.VerifyData");
bool result =
encryptionService.VerifyData(Encoding.UTF8.GetBytes(this.xmlData),
new SHA1Managed(),
Convert.FromBase64String(this.Signature));
Trace("After encryptionService.VerifyData");
}
----------------------------------------
Timestamp: 6/29/2006 4:54:07 PM
Message: Before encryptionService.FromXmlString
Category: Trace
Priority: 0
EventId: 0
Severity: Information
Title:
Machine: CHL0130
Application Domain: HelloWorld.exe
Process Id: 3056
Process Name: C:\Program Files\HelloWorld\HelloWorld.exe
Win32 Thread Id: 3876
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 6/29/2006 4:54:08 PM
Message: After LicenseProviderBase.EncryptionService.FromXmlString
Category: Trace
Priority: 0
EventId: 0
Severity: Information
Title:
Machine: CHL0130
Application Domain: HelloWorld.exe
Process Id: 3056
Process Name: C:\Program Files\HelloWorld\HelloWorld.exe
Win32 Thread Id: 3876
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 6/29/2006 4:54:08 PM
Message: Before encryptionService.VerifyData
Category: Trace
Priority: 0
EventId: 0
Severity: Information
Title:
Machine: CHL0130
Application Domain: HelloWorld.exe
Process Id: 3056
Process Name: C:\Program Files\HelloWorld\HelloWorld.exe
Win32 Thread Id: 3876
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 6/29/2006 4:54:14 PM
Message: After encryptionService.VerifyData
Category: Trace
Priority: 0
EventId: 0
Severity: Information
Title:
Machine: CHL0130
Application Domain: HelloWorld.exe
Process Id: 3056
Process Name: C:\Program Files\HelloWorld\HelloWorld.exe
Win32 Thread Id: 3876
Thread Name:
Extended Properties:
---------------------------------------- Tag: service pack ? Tag: 118515
Up/down value conversions
Greetings,
We are using an up/down control to facilitate numeric data entry,
however, we are noticing issues converting from the up/down value
(apparently a Decimal) to the units we are working with (Double) and
vice versa. There appear to be precision issues, and then we take those
numbers and scale them according to our application requirements.
Needless to say, the results are anything but what we might expect. We
could be doing some wacky scaling, but notwithstanding that, is there
anything we can do to help clean up the conversion between Decimal and
Double? Or is the answer to provide a control that better-supports a
Double-compatible input? Any suggestions are welcome. Thanks in
advance.
Regards,
Michael Powell Tag: service pack ? Tag: 118510
Up/down value conversions
Greetings,
We are using an up/down control to facilitate numeric data entry,
however, we are noticing issues converting from the up/down value
(apparently a Decimal) to the units we are working with (Double) and
vice versa. There appear to be precision issues, and then we take those
numbers and scale them according to our application requirements.
Needless to say, the results are anything but what we might expect. We
could be doing some wacky scaling, but notwithstanding that, is there
anything we can do to help clean up the conversion between Decimal and
Double? Or is the answer to provide a control that better-supports a
Double-compatible input? Any suggestions are welcome. Thanks in
advance.
Regards,
Michael Powell Tag: service pack ? Tag: 118509
Display text in different colors in a textbox using WndProc
Hi All,
I need to have a text box that displays text in different colors. I
tired overriding WndProc but I still couldn't. Below is the code
snippet I'm using.
Would appreciate if someone could help me out with this (wolud
appreciate if the solution is done using WndProc)
const int WM_PAINT = 0xF;
[DllImport("user32.dll")]
public static extern IntPtr GetWindowDC(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
protected override void WndProc(ref
System.Windows.Forms.Message m)
{
base.WndProc(ref m);
switch (m.Msg)
{
case WM_PAINT:
IntPtr hDC = GetWindowDC(m.HWnd);
Graphics graph = Graphics.FromHdc(hDC);
graph.DrawString(this.Text, this.Font, new
SolidBrush(Color.Red), 1.6F, 2.5F);
graph.Dispose();
ReleaseDC(m.HWnd, hDC);
m.Result = IntPtr.Zero;
break;
}
}
Thanks!
Shehan
p.s. I'm using .net2.0 (if its of any help) Tag: service pack ? Tag: 118508
MS Unit test and CruiseControl.Net integration
Hi All,
We are currently running continous integration using a server running
cruise control.net. This server does not have VS2005 installed on it,
only the .Net framework.
Previously, we have been using Nunit to write our tests but I thought I
would give the integrated MS unit test a go and submitted these test to
source control.... Which has broken the build because the
Microsoft.VisualStudio.QualityTools.UnitTestFramework dll is not
present on the server....
So my question is, can you run MS unit tests as part of an automated
build process without having a full install of VS2005 on the
integration server?
Thanks in advance!
Stuart Tag: service pack ? Tag: 118505
.NET UpDown KeyPress Beep
Greetings,
We are handling the KeyPress event in an UpDown control, which
determines if Enter or Escape has been pressed, then closes the dialog
with either a DialogResult.OK or DialogResult.Cancel, respectively. We
seem to be having a beep occur when this happens, at some point after
the event handler is through processing. Not sure quite why this is.
Any ideas to inspire us in the right direction? Thanks in advance.
Regards,
Michael Powell Tag: service pack ? Tag: 118494
Pinning a managed structure
Hi all,
is there a simple possibility to pin down a C# class member (a structure) so
that I can use it in an unmanaged DLL?
I only found the C# fixed() statement, but the structure is used throughout
the whole application lifetime, so fixed() does not seem to be the method of
choice...
Any ideas?
Thanks in advance,
ulrich Tag: service pack ? Tag: 118490
Maximum Characters in Stringbuilder?
Hello,
I'm using a Stringbuilder to building dynamic HTML, and I was wondering
how long it can get before it gives up. I won't know the length of the
HTML until it's finished building it. I've read a few articles that
suggest setting an initial size when you instantiate it, but will that
work even if I don't know how much I'm storing?
Any help would be appreciated. Thanks! Tag: service pack ? Tag: 118489
binding to an unsigned assembly outside the appbase
...is this possible? Can you perchance provide an entry in the config
file which would allow such behaviour?
I think it should be possible at least on the local machine, you can
always copy those unsigned assemblies to a subfolder of your app, so
it's not like it's a security feat.
Thanks for any help,
Jan Tag: service pack ? Tag: 118484
How to sign a vsi content ?
i have created a custom control and thus published it using vsi content
, but i always get the "The content is not signed dialog" . How to sign
a vsi content ?
Thanks,
Mehfuz Hossain. Tag: service pack ? Tag: 118482
Creation of HTTP streaming server using .NET HttpListener
Hi,
I'm posting this in the general .NET forum because I'm not sure into which
subcategory this belongs. I've searched through the newsgroups and found many
posts related to audio/video streaming mainly using the Windows Media
Services.
I'm trying to create an HTTP server in C# (using HttpListener,
HttpListenerRequest and HttpListenerResponse) where I can stream videos to
potentially any media player that can stream via HTTP (WMP, RealMedia, VLC).
The reason why I want to do it this way is because I already have a stream in
the ASF format, so I just need to split it in packets and send it out. So far
I haven't been able to get a stream to work correctly primarily because I
wasn't able to setup the response parameters to what they'd need to be.
It seems that I either have to set the 'Transfer-encoding' to 'chunked' or
specify the content length.
Has anyone done anything similar to this with these classes or does anyone
know if that's possible at all?
Thanks. Tag: service pack ? Tag: 118469
how do I download the right version
I am trying to install a program which requires Net Framework 1.1.4332.
Microsoft has so many different listings for this, I can't figure out which
one I am supposed to download. I'd appreciate a link or just the correct
title for what I want. Thanks for helping.... Tag: service pack ? Tag: 118466
General solution for word under cursor?
Hi -
I'm asking for a friend.
Is there a "generalized" way to identify the word under the mouse cursor
(when the mouse is not in motion) at any given moment? I can see using VB
within the context of Word or Access to do this, but was wondering if there
was a more general way or general level a .NET application.
Thanks,
Phil Freihofner Tag: service pack ? Tag: 118464
Getting Array Type From Type
Currently I am doing the following to find an one dimensional array
type of a type -
Type asSingle;
Type asArray = Array.CreateInstance ( asSingle , 0 ).GetType ( );
Is there a way to do this without creating an instance?
I do not know the array type at design time.
Thanks in advance,
Gary Tag: service pack ? Tag: 118463
Process.GetProcessesByName creates many threads
Hi,
The call to Process.GetProcessesByName() seems to create several threads
that remain for the duration of the calling application.
I have a very simple console app,
Process[] arrProcs = Process.GetProcessesByName( "foo.exe" );
Console.WriteLine( "Done" );
if I set a bp at the call, watch Task Manager, I can see the thread count of
my app jump by 8 after the call returns. I only see one thread in the
"Threads" debug window.
I also have this call is in a full-blown app. The thread count never drops.
Any ideas?
--
Thanks,
-Robin Tag: service pack ? Tag: 118462
Update Profile of Created User
I've created my own version of the CreateUserWizard control that gathers up
all the information I need when a user requests an account. Once all the
data is gathered and validated, the FinishButtonClick property calls a method
that does the following:
1. Creates the user account:
Membership.CreateUser(myName, myPwd, myName, myQue, myAns, true, out
createStatus);
(I'm using the email address (myName) as the username, which is why it shows
up twice)
2. I then want to update the newly created user's profile with the
information that was entered:
Profile.UserInfo.UserEmail = UserName.Text;
Profile.UserInfo.FirstName = FirstName.Text;
Profile.UserInfo.MiddleInitial = MI.Text;
..etc.
I do not want these profiles created for anonymous users, so my web.config
file looks like this:
<anonymousIdentification enabled="false" />
<properties>
<group name="UserInfo">
<add name="FirstName" type="System.String" allowAnonymous="false" />
<add name="MiddleInitial" type="System.String"
allowAnonymous="false" />
<add name="LastName" type="System.String" allowAnonymous="false" />
..etc.
</group>
</properties>
I have tried several methods to ensure that the newly created user is logged
in, by using the Membership.ValidateUser(), the
FormsAuthentications.AuthorizeUser(), and none of them have worked. However
the MembershipUser object returned by the CreateUser method shows that that
user is currently OnLine. I always end up with the following error message
the moment I try to call the SetPropertyValue of the first profile property:
"This property cannot be set for anonymous users."
Note that I do not want the user to be able to log in yet until their
account has been approved, so once the profile info is created I would have
to log them out and set their account to Inactive.
Thanks for any and all help.
--
Morgan
Web Developer
Portland, Oregon Tag: service pack ? Tag: 118461
Error with partitioned session
Running ASP.NET2. Every once in a while I get this error:
Unable to cast object of type 'System.Collections.DictionaryEntry' to type
'System.Web.PartitionInfo'.
at System.Web.PartitionManager.Dispose()
at System.Web.SessionState.SqlSessionStateStore.OnAppDomainUnload(Object
unusedObject, EventArgs unusedEventArgs)
I setup a partitioned session db by overriding
System.Web.IPartitionResolver and using a simple hash to return an index in
a list of connection strings.
public String ResolvePartition(Object key)
{
String sid = (String)key;
// hash the incoming session ID into
// one of the available partitions
int partitionID = Math.Abs(sid.GetHashCode()) % partitions.Length;
return partitions[partitionID];
}
I did it based on the article here:
http://msdn.microsoft.com/msdnmag/issues/05/09/SessionState/default.aspx#S8
and just did the sessiondb instead of the session state server. As I said
works fine most of the time but throws the above exception once in a while. Tag: service pack ? Tag: 118457
Coed Signing and Certifcates
Hi All,
I need to learn how to digitally sign and strong name .NET assemblies,
generating authentication certificates, etc. and add / remove certificates
from Windows certificate store. I'm completely confused by the MS
documentation as I'm completely a newbie in this area. Can anyone point me
to some good beginners references (articles/books) that have good sections
discussing basically how the public/private key pairs work and how the
signinng process works and then how to go about it using the tools .NET
provides (makecert.exe, signcode, etc.).
TIA,
--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> john.bowman@thermo.com Tag: service pack ? Tag: 118456
Get Dotnet Framework version from command line
Hi everybody,
I write a VBS script witch uses csc.exe (command line dotnet compiler),
but my problem is to detect what version of Dotnet Framework is
installed on the server to use the good repertory 1.1 or 2.0 (v1.1.4322
or v2.0.50215 ...)
What command line or script can I use to get this information ?
Thanks to all for any advice
Bruno Tag: service pack ? Tag: 118452
Combobox refresh after changing displaymember and valuemember
I want to set the values for the combobox.displaymember and valuemember at
runtime. Its seems simple enough, but after changing them in response to a
change in an option group, I can't figure out how to get the combobox to
refresh itself with the new settings. I've tried the combobox.refresh()
method.
Anyone know how to get the combo box to refresh itself?
thanks
--
dchman Tag: service pack ? Tag: 118451
OrderedDictionary - to retrieve objects in same order
Hi,
I want to use OrderedDictionary to get my objects in same order as they
are inserted in. I also want to access the objects using a key. So my
question is whether this is the best option or there is some better
collection object than OD. The current MSDN documentation dosn't says
anything in favor or against OD for retrieving object in order.
Remember I don't want ot sort objects on keys or anything else.
Thanks in advance,
Suhaib Tag: service pack ? Tag: 118448
Not CLS-compliant
I have an argument in the constructor for a VB form that as a parameter that
looks like:
ByVal lblHeader As Controls.MGLabel
Visual Studio 2005 gives me a warning:
Type of parameter 'lblHeader' is not CLS-compliant
I am not sure what to do.
Thank you.
Kevin Tag: service pack ? Tag: 118447
how to produce library documentation?
I'm trying to write the documentation of my library using XML tags.
I'm using NDoc but it doesn't support C# 2.0 very well.
Any tip on what other product I could use? Tag: service pack ? Tag: 118444
Tab Control without tab section
Hi,
Any component that work like Tab but without the all the tabs for
user to click from one view to another view. we will programmatically other
button to perform tabs view change from one to another.
hope that you guy understand what I trying to explain. I need this
because currently I using the Navigation Pane like outlook for my interface.
I think to made when user click on the navigation pane button then right
hand side pane will change to the view accordingly. I know that panel are
able to done that also, but it's very unmanaged able. when programmatically
visible and invisible those panel all the time.
Thanks for any advice in this issue.
With regards,
Goh Tag: service pack ? Tag: 118438
Freeze columns in GridView ASP.NET2.0(Urgent)
Hi
I am working with ASP.NET2.0, How can i freeze some of the columns of
GridView Control.
Thanks in Advance. Tag: service pack ? Tag: 118437
Managed to unmanaged performance
Hi all
Existing COM ATL DLL wrapping a C++ library. Interoping from a C#
application, passing a large string containng XML (5-130kb). Need to
significantly improve performance of both the interoping and the
performance of the native functions (performance critical app).
Opinions sought on most worthwhile course of action...have identified 4
options...
1. Implement a managed C++ wrapper and link to underling C++ functions,
marshalling non-native types where necessary. Thus eliminating COM
(quick win?)
2. Re-write C++ code in C#. (no quick win, not possible to re-write all
of it also)
3. Recompile C++ code with VC7 or higher (currently VC6)...quick win?
4. Re-architect C++ code (no quick win)
Thanks all Tag: service pack ? Tag: 118432
error: String was not recognized as a valid DateTime
I'm facing an error:"String was not recognized as a valid DateTime"
whille accessing DateTime from webservice.
And when I try to set DateTime to the same webservice it fails with
error:"Date value is of wrong type"
it looks like xs:DateTime is not compatible with .Net DateType. Any
suggestions on how to fix this without touching the webservice (3rd
party webservice)?
Thanks Tag: service pack ? Tag: 118431
way using splash screen
Hi,
Just think to get some comment from communitiy regarding best
pratice using splash screen. If we develop an application that need loading
database to dataset it's we need done it at main page fill up all nessarcy
table to dataset. since the splash screen only counter the main page loading
time. If I only loading database from second form than user will need to
wait without notification. It seen like bad experience to the user for
waiting so long of time to display out another form.
another example like crystal report. normally we will load crystal
report in from that is not the main form. mostly loading crystal report
requere alot of time to getting display out. But think in others way, if I
load all the form when the project is start then will consume allot of
memory.
So what is the best way to develop a good application.
Thanks for any comment.
With regards,
Goh Tag: service pack ? Tag: 118427
Versions Needed?
In my "Add or Remove Programs" list I have the following:
Microsoft .NET Framework (English)
Update Installed on 3/16/2005
Update Installed on 3/18/2005
and
Microsoft .NET Framework 1.1
Update Installed on 3/16/2005
Update Installed on 3/18/2005
Do I need both of these, or can I remove the first one?
Thanks,
Tom Tag: service pack ? Tag: 118417
"Spartaco" <boh@boh.voh> wrote in message
news:O89Js4FnGHA.764@TK2MSFTNGP03.phx.gbl...
> do you know if there is a plan from MS to release a service pack for .net
> 2.0 and vs2005 ?
>
> thanks.-
>
Planned for 3rd quarter '06, IIRC.