Answer Questions
Stubey Process.start() how to
Hi All, I'm using process.start() to execute msbuild.exe. Is there any properties or method that I could set or call to wait until it completely finished before the next line of code get executed Best Regards, When I remove theProcess.Start(); line then it throws, "No process is associated with this object." Exception. Here is the stack trace at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.WaitForExit(Int32 milliseconds) at System.Diagnostics.Process.WaitForExit() at Project_Runner.Class1.Test(String path) ...Show All
Kevin8264 DataTable does not accept field changes
I am running this test code to find out why I fail to see changes in one of my DOBC (FoxPro) *.dbf tables: private void pushVariousTests_Click ( object sender, System.EventArgs e ) { string sql1 = "SELECT * FROM 'correlates.dbf'"; string inpStr1 = "stoxx"; Class2 class2 = new Class2 ( ); DataTable dt1 = Class2.getData ( sql1, class2.getConnStrings ( ref inpStr1 ) ); foreach ( DataRow row in dt1.Rows ) { if ( (( string )row["named"]).Trim ( ) == "" ) { Console.WriteLine ("empty: {0} ", ( string )row["named"] ); row["named"] = "*"; Console.WriteLine ( "changed : {0} &quo ...Show All
PoloNet Compare filename to a mask
I have a FileInfo object. I need to compare the FullName property to a mask like "*.jpg" or "warcraft.*" or " rant.bmp" to see if it matches. How can I do this Thanks Hi Haris, Have i reached u I need to compare the filename against any legitimate filename mask, the ones used by windows including * and . Not just the ones listed. These functions work to match a filename to a wildcard pattern/mask/filter private bool FilenameMatchesFilter(string filename, string filter) { Match theMatch = Regex.Match(filename, WildcardToRegex(filter), RegexOptions.Compiled | RegexOptions.IgnoreCase); return (theMatch.Value == file ...Show All
CWinKY Best way to get around not being able to dynamically cast?
I'm trying to do something where it would be nice to be able to dynamically cast. I know this isn't possible in C# so I'm trying to figure out the best way around this. Basically the setup is I have a 'Segment' class. Then a have a bunch of classes that inherit from the 'Segment' class. Then I have a Segment collection class that has an ArrayList that stores different 'Segment's. What I want to be able to do is have a method that takes in a Type (which will be one of the classes that inherits from 'Segment') and have it return an array of Segments of that type. Something like this: private ArrayList Segmants; public Segment[] GetSegmants(Type reqType) { ArrayList thisList = new ArrayList(); &nbs ...Show All
Devin Web Service Partial Class
I just converted an application that communicates with the database via web services to VS2005. The conversion worked fine but I could not get the application to communicate with the web services. I kept getting a web method error. So, I decided to convert the web services to VS2005 as well. The conversion of the web services went well also. However, when I generate the proxy class through WSDL.exe, and add the proxy class to my application, it will not compile. The proxy class generated by the WSDL.EXE utility for VS2005 creates a Public Partial Class and the compiler doesn't like it. It throws an error for each of the three Public Partial Classes generated by the WSDL.EXE utility that states: Expected class, delegate, enum, interface, or ...Show All
wesneon help in list box..
Hi.. I am creating a windows form using c#. i have 2 listbox controls. The first list box contains the available names. i want to select an item and list in the second list box using a button, select all the items from the first listbox and list in the second listbox using another button, similarly i should be able to move the selected item(single selection) which is in the second listbox to the first listbox using a buuton and likewise select the whole of the items in the second listbox and move it to the first listbox using a button. can anyone please help me with the code... please help Thank you for the help. Is the above code to select all the times and transfer it to the other listbox ...Show All
Chris Kulhanek DLL and Namespace question
I am trying to publish a (my very first) dll for one of my C# applications and am a bit confused about the need for my customers to include MY namespace in their applications. Specifically, when I developed my dll (project output = class library) I generated a namespace called "mynamespace". So, when one of my customers uses my dll, would the customer need to rename his namespace "mynamespace" to access the methods in the dll I ask this because I have tried creating a test project that includes my.dll in its references folder. However, unless I change my test.cs program's namepace to "mynamespace" I cannot access the methods inside the dll. I have also tried "using mynamespace" but cannot access the dll. Can someone enlig ...Show All
quiklearner random alpha numeric character
how can i create an a random alpha numeric variable This is only really necessary if you are generating passwords or cryptography keys or some other scenario where you can expect that the algorithm will be hacked. For most purposes, the Random class is random enough. If you care at all about how "random" the values are, then you will not want to use the Random class. That class uses a predictable algorithm. Instead, you should use RNGCryptoServiceProvider's GetBytes() or GetNonZeroBytes(). These are a bit slower than using the Random class, but use a cryptographically stronger value generation algorithm. http://msdn2.microsoft.com/en-us/library/system.security.cryptography.rngcryptoserviceprovider( ...Show All
Deicide Microsoft.ApplicationBlcoks.Updater where can i find???
I am using C# and I am having problems adding references to my Microsoft.ApplicationBlocks.ApplicationUpdater and a few others is there some where i can download them...It seems that it did not come with the Enterprise Library 2005 for .net 1.1...can any help me out with that The 1.0 version of the Updater AB is at: http://www.microsoft.com/downloads/details.aspx FamilyId=C6C17F3A-D957-4B17-9B97-296FB4927C30&displaylang=en You can find everything related to Application Blocks by browsing to the "patterns and practices" section from the MSDN Home Page. ...Show All
xdzgor inner classes
Hello, for many years of java I haven't appreciated the inner classes feature, and took it for granted. Now when I'm using c# I know how imporatnt it is. So I tought to ask what others are doing without it. In Java I had something like this: class A { protected String myString = "A"; class B { void myMethod() { myString = "B"; } } } this means that the inner class can access any method or data member (static and non static) of the outer class, and the pointer to the outer class is created without additions to the code. I want it in c#. Is there a way to do it Thanks You have type members and instance members. Static members are type members. In class B you can access type members of clas ...Show All
johnvarney Is it possible to find the time taken to run the project file?
How can I find an exact timing taken for run the project files I am using devenv.exe to run the application. I need to hold the till the project gets run. Here is the code I had tried. Please help. foreach ( FileInfo file in d.GetFiles ( “*.csproj” ) ) { string Arg = string .Format ( "\"{0}\" /run /out \"{1}\"" , file.FullName, d.FullName + "\devenv.log" ); Process p = new Process(); p.StartInfo = new ProcessStartInfo( devLoc + @"\devenv.exe" ); p.StartInfo.Arguments = Arg; p.StartInfo.CreateNoWindow = true ; p.StartInfo.ErrorDialog = true ; ...Show All
Milad.a.p IE7 and Visual Studio
Installed Internet Explorer 7 and after that we get the message Visual Studio Busy ..... message when doing a build. We are using XP Professional. You must be kill the process with task manager after that. We tried various things, but after going back to a restore point that was the one before we installed IE7 the message has not shown up again. Any ideas on what is happening with this message I have also seen a balloon, without IE7, that indicates that Visual Studio is busy and I wonder if there is more to this issue than just installing IE7 We did not go back an install IE7 again to prove that it really was a bad install, but wit AV software maybe your right. ...Show All
GraemeWT Load user control during the run time
how can I load the user control into my main form during the run time Thanks, Tammy At the very least it's just as easy as adding any other control, you need only create an instance and add it to the Controls collection of the parent container: MyUserControl control = new MyUserControl (); this .Controls.Add(control); You are free as well to put any additional init info you'd like between the two above lines. Thanks Brendan, it helps! ...Show All
jayaraja How to set/rest RTS pin using Visual C#
I am trying to set and clear the RTS pin for a custom application, using MS Visual C#. I am using the Serial Port Class that is built in. I see an RTSEnable method, but I do not think this toggle the RTS pin (it seems to put the com port in an rts/cts handshake mode). Any ideas Thanks RTSEnable does set the RTS pin on and off. I was also a bit baffled by the documentation, but it does work that way (which is also reasonable... you can already set the protocol otherwise). If you only need to power a device (common enough), this is the way to go. If instead you are trying to use the RTS for out-of-band communication, you might have some speed issues. See this article for some rather unortodox application. ...Show All
ArchanaG Caret Position SelectionStart, Simple?
This should be simple... I have a maskedtextbox on a form, and I've added an OnEnter event which I want to set the caret position to zero (it defaults to the end). From what I've read you should use the SelectionStart Property to do this, but I can't get it to work. In the debugger it seems to reflect the correct selectionStart position but even though I set the value the caret doesn't get repositioned. I've also tried setting the selection length to various numbers along with the selectionStart... Any help would be greatly appreciated. Try this: maskedTextBox.Select(0,0); Cheers ;-) I've gotta be doing something wrong. This is driving me crazy! This didn't work, I stepped through the debugger to make ...Show All
