I use both zip (for solutions) and plain txt for other more simple things. That way I can do a simple windows-search on the filenames. A simple class: GetFileIcon (win32, shell, pinvoke).txt A solution with the basic send/recieve and conversion: TcpClient-TcpListener (network, socket).zip
Michael9000
Posts
-
a little help on "most used" codes ! -
a little help on "most used" codes !When I started programming I created a lot of small code-samples to the the hang of the more complex things, and they are zipped with search-tags in their filenames. Now I'm doing the same for the abandoned projects thats worth saving.
-
C# DirectX - redirectiong audio to another outputAs far as I remember it cant be done with basic audiovideoplayback. You might want to take a look at DirectShow instead, since you can define exactly what you want the player to do. You can start with the simple-playback sample from http://directshownet.sourceforge.net/[^] and add a DsDevice (aka soundcard output) to the graph (google how to).
-
Video stream modificationsTake a look at snarfle's DirectShow.NET - that'll make DS a whole lot easier to work with in C# http://directshownet.sourceforge.net/[^]
-
Wierd exceptions when calling WCF more than once from a static classThanks. I couldn't find InnerChanel on the svc, so I'll see if I can find another way around it.
-
Wierd exceptions when calling WCF more than once from a static classDid you just read my offline code or my mind!? That's 99,9% the original code except 'svc.innerC...' and my out-commented 'Debug.' :) Now that's thougths that I like :thumbsup: It's getting a little late in the evening here, so I'll have to try it tomorrow morning. But it seems you like you know the "little thing" I need to change
-
Wierd exceptions when calling WCF more than once from a static classYou think like me :), that was som of the first things I tried - without success.
Ravi Bhavnani wrote:
Have you tried setting the timeout of the client proxy (at run-time) to a comfortably high value?
Yes, tried that as the first thing. Changed timeout to 180 seconds (server responds in less than 4 seconds).
Ravi Bhavnani wrote:
Is there an uncaught exception occuring on the service end?
Not likely. The server always responds with, at least, a empty List within 4 seconds. (same for another test-method that simply takes a string and returns the same string).
Ravi Bhavnani wrote:
Is the returned list guaranteed to be not-null?
Yes. (at minimum it's a empty List of objects).
modified on Monday, January 17, 2011 6:54 PM
-
Wierd exceptions when calling WCF more than once from a static classWhat you described is exactly whay I'm getting (a and b). Not entirely sure what you mean, but I create a new for each call
public static class
{
public static List<Assignment> Test()
{
MaintenanceService svc = new MaintenanceService();
List assignments = svc.GetAssignments().ToList;
svc.Dispose(); // <- this makes no difference
return assignments;
}
} -
Using a Class in a C# console application [modified]Pete O'Hanlon wrote:
The OP doesn't get replies to posts sent to me, so you might want to address it to him instead.
Ooops, didn't know that, 'cause That's the most common way in other forums
-
Wierd exceptions when calling WCF more than once from a static classNot necessarily. I'm using a static Maintenance-class (where the previously posted code is called from a static method), because it has to make the same list of objects available throughout the entire app (Gui+Backend). Edit: svc.dispose don't make any difference after the code in opening-post. (Performance doesn't really matter - time does (my deadline is in approximately 48 hours).) Any ideas are welcome. I'm stuck (I'm probably thinking about this i a wrong way) ?
-
usb device (not the storage volume type)I'd guess (a wild guess) that the handle for A and C wouldn't change if it's being used when B is disconnected/reconnected. (maybe google how multiple USB TV-tuners keep using the ones that arent dis-/re-connected)
-
Mysql in vb.net2008 on vista then its give error(Unable to connect to any of the specified MySQL hosts.)I see 1 posibility that spring to my mind. - MySql Connector is not installed on your Vista.
-
Disable cd/dvd eject button with codeNot a code example, but you can disable CDROM/Remoable Driver/etc. in Windows' Group Policy (at least in Windows 7)
-
Using a Class in a C# console application [modified]I Agree, but if you want to see how it can be done in c#, create a new WinfowdFormsApplication and take a look at it's Program.cs
-
Wierd exceptions when calling WCF more than once from a static classI'm using Compact Framework 3.5 on a phone to contact a WCF-service, but I think my question is more related to this message board. When the code below is called a second time, from a class that is implemented as a singleton, it ends in som really unexpected errors. It works fine the first time it's run.
MaintenanceService svc = new MaintenanceService();
List<Assignment> assignments = svc.GetAssignments().ToList<Assignment>; // Fails hereThe second time, it randomly throws 2 different exceptions (only one each time): - Sometimes it's a TimeOutException (System.Net.HttpWebRequest... - in VS-generated code). - And Other times it's a ObjectDisposedException (system.threading.timer for the WCF-TimeOut - in VS-generated code). If I use the same code from a Button_Click in a Form, it works every time, so I know it's not the service that are causing the error. I really need som help on this one?
-
Converting VB's IIf to Conditional Operator in c#Absolutely right. :thumbsup: (I incorrectly assumed that true would be 1 and not -1)
-
Converting VB's IIf to Conditional Operator in c#Thanks Geoff I didn't write the code (but that line is working) - maybe the compiler converts the boolean to a 0 or 1 in the background. I'll test it later
-
Converting VB's IIf to Conditional Operator in c#It's been a while since I've used VB and I need help with understanding the truePart in the second line.
Dim asciiBytes As Byte() = Encoding.ASCII.GetBytes("SomeAsciiData")
Dim nextchar As Integer = IIf(asciiBytes.Length > (i + 1), asciiBytes.Length > (i + 1), -1)
How does
asciiBytes.Length > (i + 1)
return an integer? -
Installellllllllie wrote:
what to do if the user has cancelled the installation
Restore the old app-files if the user cancelled the update !
-
windows serviceIy shouldn't be nessecary to reinstall every time the xml changes. You could add a
FileSystemWatcher
to monitor changes in the xml-file and make the service load the updated xml-file.