.net

Write XML in Silverlight with VB

is it possible to write xml in silverlight with vb ...

What idiom (if any) do you prefer for naming the "this" parameter to extension methods in C#, and why?

The first parameter to a C# extension method is the instance that the extension method was called on. I have adopted an idiom, without seeing it elsewhere, of calling that variable "self". I would not be surprised at all if others are using that as well. Here's an example: public static void Print(this string self) { if(self != null...

How to make a .Net or JVM language?

I am seeing all these new languages for .NET and JVM. How does one begin to make one? I can't find any good documentation on JVM or MSIL specifications. Edit I already know how to parse, I am more interested in how there are so many people making new languages that are based on those platforms. ...

UDP, NAT and setting up "connections"

I know the word "connection" isn't really appropriate when talking about UDP, but... How does a server (the one with the known IP) get its UDP packets through the Internet to a client that is behind NAT? For example: say a client connects and authenticates to the server using some messaging over TCP. At this point the server is ready t...

Computing file HASH returns different values.

Does anybody know, why the following code returns different results on some machines? Private Shared Function ComputeHashValue(ByVal Data As String) As String Dim HashAlgorithm As SHA512 = SHA512.Create Dim HashValue() As Byte = HashAlgorithm.ComputeHash(Encoding.ASCII.GetBytes(Data)) ' Looping over the array and ANDing each...

Maximum .NET achievable memory?

Which is the maximum amount of memory one can achieve in .NET managed code? Does it depend on the actual architecture (32/64 bits)? ...

Get group membership fast

I am trying to figure out whether the current windows user either is local administrator or can use UAC to "attain" that group membership. What I've come up so far looks like this: var adminIdentifier = new SecurityIdentifier("S-1-5-32-544"); var current = WindowsIdentity.GetCurrent(); bool isAdmin = current.Groups.Contains(adminIdent...

Have you ever used ngen.exe?

Has anybody here ever used ngen? Where? why? Was there any performance improvement? when and where does it make sense to use it? ...

How do I draw an annulus (doughnut) using GDI+?

I have been trying to draw an annulus (ring with thickness) with a transparent hole and a gradient rim in C# with very little success. Does anyone have any suggestions on how to do this? here's a nice Blend Utility Here's the Final result - thanks to BlueMonkMN Rectangle GetSquareRec(double radius, int x, int y) { double ...

Reflection - Get the list of method calls inside a lambda expression

Hello all, I am trying to find a way to get the list of method calls inside a lambda expression in C# 3.5. For instance, in the code below, I would like to method LookAtThis(Action a) to analyze the content of the lambda expression. In other words, I want LookAtThis to return me the MethodInfo object of Create. LookAtThis(() => Create...

i want to send from webuser'sdata to webuser'sdata

Hello again; i created web user control, it includes one listbox and also give propert with listdictionary to fill listbox. if you lok below: public ListDictionary Items { get { if (items == null) items = new ListDictionary(); return items; ...

Receiving datagrams sent as a broadcast message by a remote host

I need to receive datagrams that are sent as a broadcast message by remote host connected on the same lan. I am using UDPClient but have no idea which method to use.There is a method UDPClient.Receive but that requires as parameter a specific IPEndPoint which is obviously not wanted since it is a broadcast message that I need to receive...

How to work with dataset's datarelation in linq?

Can someone provide an example of linq querying various nested tables in a dataset? I can't find something like that on the net. Thanks ...

How can I (an American) test whether my ASP.NET/SQL Server app is handling decimals correctly for Germany.

In the US, you use a "." as the separator, but in Germany you use a ",". I'm trying to test whether my logic is smart enough to handle either one but I seem to be failing to put my Windows 2000 machine into German mode. I went to Control Panel, Regional Options, and changed "Your locale" to "Germany". I then restarted both IIS and SQ...

Dynamic Repeater in C#.net

I am trying to create nested repeaters dynamically using ITemplate. This repeater is like that I am passing List<Control> and it generates repeater. Issue is that when I databound outer repeater. Only the last nested repeater shows. Following is screen shot. Markup <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Defaul...

How can I start an application on a different system remotely?

I've got a situation where i have one system running a master application that communicates with slave applets on other systems, problem is, i can't guarentee that the slave applets will be running, nor that an operator can physically utilize the system to start the applet (and I'm also assuming they don't know how to use Remote desktop,...

Please suggest .Net Job/Task Queue

I need to build a network of services that will process data. Each service needs its own task queue. Preliminary I will need operations like QueueTask, CancelTask, StopTask, GetTaskStatus and GetTaskProgress. I am looking for framework or fully built implementation of Task Queue. At this time I know some options: MSMQ - It OK for my n...

For Each Loop Not Working When Removing Items From ListBox

why can not i use foreach loop to drop items from listbox: protected void btnRemove_Click(object sender, EventArgs e) { ListBox listbox = Controltest2.FindControl("ListBox1") as ListBox; if (Controltest2.Items.Count > 0) { foreach (ListItem li in listbox.Items) ...

WCF client/server model

I'm looking to create a rich-featured application using a client/server model, using WCF as a possible communications framework. I will host the service(s) in a Windows Service (so with WCF I'd using netTcpBinding). Now, I suppose I could define every service operation into a single service contract, but there could be quite a few oper...

Is string.Length in C# (.NET) instant variable?

I'm wondering if string.Length in C# is an instant variable. By instant variable I mean, when I create the string: string A = ""; A = "Som Boh"; Is length being computed now? OR Is it computed only after I try to get A.Length? ...