Groups | Blog | Home


Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
all groups > c# > february 2007 > threads for wednesday february 21

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

How to clone a "Control"
Posted by Rob Stevenson at 2/21/2007 8:37:56 PM
Does anyone know how to do this accurately. I really only want to clone the design-time properties which should make the task easier. I've searched high and low however and still can't find a problem-free solution. Even (ad-hoc) solutions posted by MSFT employees have problems. For instance, i...more >>


Check what PC a user is logged into
Posted by fomalhaut at 2/21/2007 6:47:37 PM
Hi All, I am building a tool for one of our company's service desks, and one of the functions I'm hoping to add is the ability to enter a username and find what PC that user is currently logged into. As AD doesn't store this kind of information, is there any source I can get this informatio...more >>

Re: How do I use AppDomains and add search paths to it?
Posted by Eric Renken at 2/21/2007 6:10:48 PM
OK, now I am trying to implement this and it just isn't working. Here is my basic code: System.IO.FileInfo fi = new System.IO.FileInfo(path); AppDomainSetup setup = new AppDomainSetup(); setup.ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;...more >>

ToolStripMenuItem X Y Position
Posted by Dave at 2/21/2007 5:42:36 PM
How do I show a context menu directly underneath a tool strip menu item? I tried this, but a menu item is not a control so it will not build. private void siteToolStripMenuItem_MouseDown(object sender, MouseEventArgs e) { // contextMenu.Show((Control)siteToolStripMenuItem.Owner, e.X...more >>

Setting a password on an AD account...
Posted by Joe at 2/21/2007 5:34:08 PM
OK, I have code that I used in a standard windows app that would create an account and then set the password. I have taken that code and am using it in a Web App. Here's the code: user.CommitChanges(); user.Properties["userAccountControl"].Value = 0x200; //Normal user user.Invoke("SetPa...more >>

Launch Printer Control Panel
Posted by Eric Renken at 2/21/2007 5:20:21 PM
Is there a way to Launch the Printer Control panel from a C# application, and if so will the same command work on a Vista computer? I am thinking I will have to do a System.Diagnostics.Process.Start, but I don't know what I need to start. Thanks, Eric Renken ...more >>

Get the value of one cell from a DataGridView?
Posted by Edwin Smith at 2/21/2007 4:39:39 PM
Hello: I have a DataGridView control and I want to doubleclick a row and get a single cell value. Here's a snippet: private void pATIENTSDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { textbox1.Text = [the contents of the cell at column4 of the row t...more >>

How to define own message struct?
Posted by Rainer Queck at 2/21/2007 4:30:53 PM
Hello NG, in forme times (decades ago :-) I used to definy my own message structs in Delphi like this : TGbReportMessage = packed record Msg: Cardinal; Action : Word; ActionId: Word; Handle : UINT; Result: LongInt; end; Can I do the same in C# and if yes how?...more >>



c# auto close
Posted by Chris at 2/21/2007 3:50:02 PM
how to create this app: - when you launches an app, it will start working. When it has finished, a new form with info will be shown (with a button). Then, the app waits i.e. 5 secs for user. User within these 5 secs can click the button and the form will be close (and the app exits) or afte...more >>

HTML AJAX to ASP.NET 2.0
Posted by Thom Little at 2/21/2007 3:23:13 PM
I am looking for an example of ... - HTML or ASP 3 client using AJAX - ASP.NET 2.0 web page or web service Web Page or Web Service returns an XML packaged string to the client. Any suggestion? _______________________________________________ Thom Little www.tlanet.net Thom Little...more >>

DataTable.Load Question:
Posted by probashi at 2/21/2007 3:12:21 PM
Is there any thing wrong in the following code? Thanks. ---- public static DataTable GetDataTable() { DataTable dt = new DataTable(); string SQL = "select * from authors"; using (OracleConnection con = new OracleConnection(System.Configuration...more >>

c# cannot change registry value
Posted by Chris at 2/21/2007 2:33:16 PM
I have Visual Studio 2005 Express Edition. I am trying to change registry value by: RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\My_app"); key.SetValue(name_of_value, new_value_string); I am getting error: System.UnauthorizedAccessException: Cannot write to the registr...more >>

DeflateStream question
Posted by bthetford at 2/21/2007 1:59:46 PM
I am trying to roll a simple compression scheme for network communication in an app I am developing. On the sender side, I compress each block of a set amount of bytes individually, then send it over the NetworkStream along with the size of the original data, the size of the compressed data, and...more >>

Deleting data in dataset
Posted by David at 2/21/2007 1:48:28 PM
Hi all, Using C# 1.1 I have a dataset loaded from an XML file. The idea being that if the app (a winform app that relies on a webservice) is offline, then I save data locally in XML and update the web service later. So, when I update, I have something like... DataSet siteLinks = n...more >>

Convert C# to VB.Adding Eventhandler.
Posted by Jim Andersen at 2/21/2007 1:47:33 PM
I have this piece of code I am trying to convert from c# to vb.net. It's a Windows project. This line gives me trouble ( I have tried to compress the code for readability. Hope I haven't screwed up): m_CA.AnEvent += new U.U_EventHandler(evt); I assume this is a c# way of adding an addition...more >>

content-transfer-encoding question
Posted by Hardy Wang at 2/21/2007 1:21:10 PM
In .Net 1.1 the default content-transfer-encoding is 7bit, in .Net 2.0 it is changed to quoted-printable by default. This change breaks some of my application (don't ask why, the other party could not process quoted-printable). In MailMessage class, I have no control over this encoding, any...more >>

TreeNode.ChildNodes not available
Posted by Phil at 2/21/2007 1:18:10 PM
Can someone tell me why the ChildNodes member of the TreeNode class is not available. I am using VS 2005 and the help file tells me it should be available in .net 2.0, but it is not listed in the dropdown member list and if I add it anyway, it gives me a compiler error: Error 3 'System.Win...more >>

Showing context menu on a right click
Posted by avanti at 2/21/2007 12:45:53 PM
Hi, I am trying to show a context menu on a right click in some of my controls. I want to show it at the right location. However it is getting shown away from the mouse click location. Here is the code: private void QueryTreeView_Clicked(object sender, EventArgs args) { ...more >>

Having problem getting query executed in a DataSet
Posted by weird0 at 2/21/2007 12:16:17 PM
What I did is create a Dataset and then the option "To select multiple columns was grey" so forcefully I had to "To select the one that returns a single value". I wrote the query for it which is as follows: SELECT atm_amount,atm_branch,atm_date,balance FROM ATM_Transactions WHERE user_i...more >>

User Control Inheritance - Swapping user conrol at runtime
Posted by wildThought at 2/21/2007 11:56:16 AM
I have a window with a user control on it. I want to be able to swap out different user controls depending on a menu choice. The swappable user controls UserControlBaseA and UserControlBaseB are inherited from UserControlBase. What I did is I placed UserControlBase on my window and it has a ...more >>

RedirectStandardOutput & OpenTextFile Conflict
Posted by ShieldsJared NO[at]SPAM gmail.com at 2/21/2007 10:47:25 AM
Hello all, So I recently found out about redirecting the Standard Output of a vbscript back to my C# app but I've found a problem. When I run a script that calls OpenTextFile, I do not receive anymore of the standard output after that call is made. Here is my code: ----------------------...more >>

ADO.NET connectionstring and pooling
Posted by njdude at 2/21/2007 10:43:32 AM
When i run this sp_who I see the connection showing up and in the next second it is gone. The connectionstring i have is Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;pooling=true;Min Pool Size=2;Max Pool Size=50;Connection Lifetime=120;Initial Catalog=test...more >>

Serial Communication Port Help
Posted by laura salhuana at 2/21/2007 10:32:27 AM
Hi: I am trying to write a serial communication GUI application. My application has the following specifications. When I set my board up in hyperterminal I do the following set up: bits per second = 38400, data bits = 8, parity = none, stop bits = 1, flow control = none. Then once I hit...more >>

Changing the blinking cursor in a TextBox
Posted by fbergroth NO[at]SPAM gmail.com at 2/21/2007 9:09:20 AM
Hi, I'm quite new to C# allthough I've been programming in other languages for quite a while. I'd like to change the blinking cursor inside a TextBox, I guess I must derive the class and override the OnPaint()-method, however I have no clue what to do next. I want to be able to switch the blin...more >>

RE: Concerns over Excessive Testing of Chemicals in Europe
Posted by from_tpg NO[at]SPAM yahoo.co.uk at 2/21/2007 8:41:04 AM
A new European Chemical Testing Policy called REACH has now been finalised by the European Union. Under these proposals Chemicals of every kind - from those used in industrial processes to the ingredients of consumer products - will be tested on...more >>

Check to see if object instance exists
Posted by Larry at 2/21/2007 8:33:25 AM
Thanks in advance. what is the C# equivalent of the VB.net IsNothing(object) function? just trying to check to see if an object instance already exists. does someone have an example? *** Sent via Developersdex http://www.developersdex.com ***...more >>

global "Windows-wide" shortcut keys
Posted by kellygreer1 at 2/21/2007 8:26:06 AM
Is there an easy way from .NET to register a Windows-wide keyboard shortcut? I would like to bring up a WinForm window from an already running .NET application whenever this keyboard shortcut is used. I assume the way to do this is calling the Windows API from .NET. Anyone have an experience ...more >>

LED style text display control
Posted by jediknight at 2/21/2007 8:06:01 AM
Does anyone know of any examples of doing LED style text displays? I need to implement a text display which has one line of 20 characters. There was an example on Codeproject but I cannot seem to find it now. ...more >>

Arrays/Literal Notation
Posted by AA2e72E at 2/21/2007 7:47:37 AM
int[, ,] array = { { { 1, 2, 3, 3 }}, { { 7, -1, 9, 0 } }, { { -1, 0, 7, 8 } } }; // 3D In the line of code above, am I using 'literal' syntax/notation to create the array? The rank of the array is 3, its dimensions are 3,1,4. How would I change the code to produce a. an array of dim...more >>

how to exit
Posted by Jerry at 2/21/2007 7:45:10 AM
I need to be able to exit my program completely no matter what. I am not able to do this with any of the following commands: this.Close(); vfData.ActiveForm.Close(); Form.ActiveForm.Close(); Application.ExitThread(); Any ide...more >>

Netbios in C#
Posted by Magnus_T=F6rnvall at 2/21/2007 7:38:57 AM
Hi! I'm trying to write a program that can tell if a remote computer is running Windows or not. The thing is, it have to go very fast, so I don't want to "connect" to the computer. My plan is to send a netbios request and if I get a response I know it's probably a Windows machine. The pr...more >>

Changing a Process's context
Posted by Day at 2/21/2007 7:12:35 AM
Hello! I'm programming in C# on .NET 2.0, Windows XP SP2. I'm using a third party's DLL in an environment that limits access to the hard drives save for a single, set user (recognized to access the drives by name). The dll functions use Process.Start and run under the logged on User's context,...more >>

Windows Form Dictionary
Posted by oz at 2/21/2007 6:47:45 AM
Hi All, I want to make a dictionary with windows application. My data is html format. therefore, i use webBrowser control on my windows form. If the user click any word in webBrowser control, word mean must browse to user (like babylon). I have a windows form. My form has webBrowser control....more >>

simple regex?
Posted by Jerry at 2/21/2007 6:22:24 AM
I know this is too easy, but I am not getting it. I want to regex string to find any string that has non numeric characters, integers and floats verification basically. I am using the following: !Regex.IsMatch( varValue, @"(\b[^A-Za-z\\.]*\b)" ) To filter through a basic ...more >>

Replace line feed in RTF
Posted by Dave at 2/21/2007 6:06:23 AM
I am replacing tags with db info. My problem is I some of the addresses do NOT have an address1. end up with a blank line. I want to get rid of that line I am using the following code to replace tempbbb.Rtf = tempbbb.Rtf.Replace("<address1>", newArray[i].ToString()); <firstName> <lastN...more >>

What Warning level you use?
Posted by Eran.Yasso NO[at]SPAM gmail.com at 2/21/2007 5:31:30 AM
Hi, As subject says. Just wondering... I am in level 4. Thanks. ...more >>

Signature. What is it?
Posted by AA2e72E at 2/21/2007 2:30:50 AM
Am I correct in thinking that the <signature> of a function is its <syntax> i.e. the arguments and the order in which they are specified when calling the function?...more >>

InstrRev (VB) --> C# ???
Posted by Andrew at 2/21/2007 12:09:15 AM
One year ago I have programmed in VB. There was a function named "InStrRev". In C# I don't have found a similar function. Can anybody help me in this question. Thanks a lot regards andrew ...more >>

Developing a WYSIWYG - IDE type application. How would you do it?
Posted by iKiLL at 2/21/2007 12:00:00 AM
Hi all I have been asked to develop a solution that is customisable by our clients. It is supposed to run on the Windows Mobile 5.0 CF2.0 environment using Merge Replication. I have looked into allowing the creation of Addin's but that has been rejected as it would require t...more >>

interprocesscommunication
Posted by TonyJ at 2/21/2007 12:00:00 AM
Hello! Assume I have several exe files running and all these constitute the actual application. To be able to log errors and different types of trace my intention is to have a separate exe file that take care of the actual writing to a file. Between the exe files(application) and the exe fi...more >>

Changing file/folder names
Posted by Jay at 2/21/2007 12:00:00 AM
What's the recommended way to change file/folder names within a project? I want to change the solution name from (say) sol1.sln to sol2.sln, and also everything else named sol1.* (eg sol1.suo, the folder sol1, and within this folder, sol1.csproj, and also, files within Debug and Release folde...more >>

Socket Exception
Posted by Steve Walton at 2/21/2007 12:00:00 AM
We have a little server application that sends data down to a client application via a TCP/IP socket over port 30006. These applications are both written in C#. They have been working on our site for a couple of years. Now, we are trying to use these applications at another site and we get an e...more >>

Strange compile error
Posted by TonyJ at 2/21/2007 12:00:00 AM
Hello! I have downloaded a project from the site "The code project" but I get the following 3 compile error. C:\tony\IPC\AppModule.NamedPipes\NamedPipeNative.cs(548): Missing XML comment for publicly visible type or member 'AppModule.NamedPipes.SECURITY_ATTRIBUTES.nLength' C:\tony\IPC\Ap...more >>

stuck on reflection latebinding assembly problem
Posted by Peted at 2/21/2007 12:00:00 AM
I have 2 samples of code bellow that work fine at the moment the first routine loads an dll assembley and instantiates the type in the dll which is always a form, and creates a child form from it. I need to use latebinfing becasue the dll to be loaded is selected by the user but is allways a...more >>

assembleys having the same identities
Posted by Peted at 2/21/2007 12:00:00 AM
Bellow is a snippet from the ms website about using loadfile on assemblies that have the same identities. I beleive this "identity" issue may be the cause of a problem i have using the alternative Loadfrom option to load the assembly. Cany anyone explain to me what this "identity" issue is, ...more >>

help using relative file paths with loadfile
Posted by Peted at 2/21/2007 12:00:00 AM
Hello bellow is select sample of code im using to dynamicaly load assembley's and it works, but the assembley.loadfile requires that i use a absolute directory path. Is there anyway i can use a relative file path. I just want to access the dll in subdirectory "deviceinterface" to where the ...more >>

FileOptions in FileStream ctor
Posted by Rolandas Rudomanskis at 2/21/2007 12:00:00 AM
Hi guys, My question is about unbuffered IO in FileStream. According to this publication: http://research.microsoft.com/research/pubs/view.aspx?tr_id=841 "There is no simple way to disable FileStream buffering in the V2 .NET framework." And from .NET framework 2.0 SDK documentation ab...more >>

Help needed... problem with collection property
Posted by --== Alain ==-- at 2/21/2007 12:00:00 AM
Hi, Sorry to open a new post but i still do not have solved my issue with Collection property and i'm really blocked. I have a control which has a collection property. when an item of the collection property will be added, removed, and so on, i would like to refresh the control itself. ...more >>

ANYONE INTERESTED IN FREE BACKUP SOFTWARE IN C#
Posted by apsorakhmer at 2/21/2007 12:00:00 AM
Hi, FREE zip compression backup software at http://www.apsorakhmer.com ...more >>

import emails from webserver
Posted by Nick C at 2/21/2007 12:00:00 AM
Hi I am trying to import emails from a webserver. This code retrieves only 1 email. I also would like to save them into an xml file? thanks N Request = (System.Net.HttpWebRequest)HttpWebRequest.Create("http://email-server/Exchange/account/Inbox/EmailSubject.EML"); Request.Credentia...more >>


DevelopmentNow Blog