|
And any time I can point that out I will. I'm anal that way. 
|
|
|
|
|
Hello,
I have written several applications with C# and have never had this problem:
I have an application who's process remains in TaskManager even when i've closed
the application. Is there something obvious I might be missing?
Thanks..
|
|
|
|
|
|
Any multi-threading involved, directly or indirectly? A second thread could have been started, the main thread won't end until it does.
only two letters away from being an asset
|
|
|
|
|
I'm using a webclient. Does this open its own process ?
If so what is the "form_close" event? I guess i need to kill
the webclient in this event. right?
Thanks
|
|
|
|
|
Unleash a debugger on it and see what it's up to.
Steve
|
|
|
|
|
IS this a sub process? If so, make sure you exit or kill it before closing the outer process.
|
|
|
|
|
Hello All,
I can't seem to find this control by the above name. I'm sure i exists in .NET or am I wrong.
I just need a dialog like the OpenFileDialog that allows me to choose a directory.
Thanks
|
|
|
|
|
FolderBrowserDialog, IIRC.
|
|
|
|
|
grrr,
Thanks the one.
cheers
|
|
|
|
|
test
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
dasdfasdf
I knew it would end badly when I first met Chris in a Canberra alleyway and he said 'try some - it won't hurt you'..... - Christian Graus on Code Project outages
|
|
|
|
|
hi
in one of part of my application (implement with C# 2005) need user can write something to write in CD.
can you give me a reference to do it (write CD) ?
tanks
|
|
|
|
|
So how does one overload an API like char.IsDigit() with more params and much more functionality?!
Can we do that in C#?
Ideally char.IsDigit() can compare a char (could be a char at a given index in a string), to see if it is a digit.
However what i need to mutate it to be able to take in a whole string, and the number of chars in that string i want to check are digits?
Since there is no method available for strings for a one statement check, I could overload a method from the char class to do this job?
something like
if ( char.IsDigit( stringBuff, i, n))
{
}
bool char.IsDigit(string str, int i,int n)
{
//checks n chars starting from i in str if they are digits;
}
PS: Am struggling with the cyclomatic complexity in the methods!!
------------------------------------
Vision is the ability to see the invisible
|
|
|
|
|
You can if you're using the C# 3.0 compilers (i.e. VS2008), note that because .NET 3.x uses the same CLR as 2.0 the compiled code can also run on .NET 2.0 but you need the newer compilers.
You can do this using something called extension methods, in your example you'd have to create a class such as:
namespace System
{
public static class CharExtensionMethods
{
public static bool IsDigit(this char c, string str, int i, int n)
{
}
}
} You might be wondering why I've included it in the System namespace, this simply means that you don't need to import a custom namespace to access the extension method in any of your classes where you'll use it. E.g. if you'd put it in a different namespace such as PooreDesign.ExtensionMethods then your code which uses it would have to be such:
using System;
using PooreDesign.ExtensionMethods;
namespace ConsoleApplication1
{
static class Program
{
[STAThread]
private static void Main(string[] args)
{
bool isDigit = char.IsDigit(args[0], 0, 5);
}
}
} Check out this blog post[^] on how to enable Extension methods in .NET 2.0
|
|
|
|
|
Cheers mate!
I dont use VS2008 yet, am still on 2.0 with 2005!
Anyways, i decided to use IsDigit as a seperate method compromising on the compile time overhead, but nevertheless, that piece of info will be useful when I start using the new 3.0 compiler, and thats coming soon!!!!
Although instead of that, what about using a simple operator overloading?! maybe overload the "=" operator with a definition like that?! am just brainstorming
Thnx
------------------------------------
Vision is the ability to see the invisible
|
|
|
|
|
Spykraft wrote: compromising on the compile time overhead
I don't see what you're talking about unless you mean that if such a method were built in you wouldn't have to compile it. But even that's not a big deal as you could put the method in your own DLL and not have to copile it each time anyway.
At any rate, you should step back and decide what it is you have and what you want to do with it.
I say you have a string and want to know whether or not all the characters in it are digits, so doing somthing with char doesn't seem appropriate. I prefer a library of routines to perform on strings, an IsAllDigits method could be written that uses a Regular Expression. Others on here are better at Regular Expressions than I, but something as simple as "^\d+$" may suffice.
The command-line compiler for C# 3 is already available.
|
|
|
|
|
Spykraft wrote: maybe overload the "=" operator with a definition like that?! am just brainstorming
You can't overload operators using extension methods because they're static methods and you can't define static extension methods (if that made any sense).
Spykraft wrote: when I start using the new 3.0 compiler, and thats coming soon!!!!
I've been using the trial of VS2008 while I wait for Imperial to get they're copy and then I can "upgrade" to a licensed one and personally I find it much much better than VS2005. For example you can use the var statement for defining variables in 2.0 projects quite happily. You can always set the default project type to 2.0 and then just use the new environment with the new compiler.
|
|
|
|
|
I suppose you could use a Regular Expression.
Or use int.TryParse
|
|
|
|
|
i want to display some string when the value of field equal a certain value
what formula should i add
thanks
|
|
|
|
|
When I program in Java I have a steam option available called ObjectStream which allows me to read/write objects to (in particular) a network stream (or what is better known as a Socket). This allows me to send open a socket and send several objects down to the other end and then close the socket.
Is there something similar in DotNet? I knwo that Remoting is available but this is not exactly what I am after?
Many thanks in advance.
Bara
|
|
|
|
|
PhantomLix wrote: Is there something similar in DotNet? I knwo that Remoting is available but this is not exactly what I am after?
Well that's what remoting does, sort of ++. There is also Serialization where the serialized data can certainly be written/read to/from a stream.
led mike
|
|
|
|
|
Yes. You need to open a socket (probably using the System.Net.Sockets.TcpClient class), get the stream for that connection (probably a System.Net.Sockets.NetworkStream), and serialize your object over the stream (probably using the System.Runtime.Serialization.Formatters.Binary.BinaryFormatter class). Then the other side can deserialize the object and reconstruct the original. Your objects must be serializable, either by default (all state information must be exposed by properties with serializable types), or by you implementing the ISerializable or IXmlSerializable interfaces. Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I'll state first off I'm not entirely certain if this, or the COM board is the most appropriate venue because it overlaps several issues. I'm trying here first since it has the largest audience.
I'm developing a managed COM wrapper for some existing C# components for use in a VBA (excel) application. One of them is a static class around a configuration file. Its constructor uses System.Windows.Forms.Application.StartupPath + "\relativePath\filename.ini" to construct the path to the data file.
In my VBA application StartupPath returns the path to Excel.exe, not the .XLS file with the VBA code or the COM DLL. Nor can I find a way to get the path to either of those files (both of which could be used to construct the path) programmatically. Because the constructor is static, I can't pass the path in as a parameter.
Without changing the behavior of the ini reader to move initialization outside of the constructor, is there any way around this problem?
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
string callingCodeLocation = Path.GetFullPath(Assembly.GetCallingAssembly().CodeBase); Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|