Is there an equivalent to browser cookies for Smart Client / Click Once application development on .NET 3.5? Some place I can store cookies on the user's machine rather than the server.
Or to put it another way - what file location can you write to from a sandboxed Click-Once app that won't violate good security practices. I don't wa...
To me they are very similar structures. I was hoping there was a way to cast or convert one to the other easily.
I'm using reflection to do some magic. I've chosen the path to use parametrized constructors to create some user selected objects which they fill in values for the parameters using a UI.
The problem is one of the objects tak...
I've got an XPathNavigator at the root of a document. Several levels down, there's a group of numeric values that I want to sum. I could always loop through the nodes and add them myself, but since I knew the XPath spec included a sum function, I decided to try to use that. I'm running into an error.
System.Xml.XPath.XPathException - Ex...
Is it possible to mock the Assembly class?
If so, using what framework, and how?
If not, how would do go about writing tests for code that uses Assembly?
...
I'd like to retrieve all local groups on my machine (Vista in a W2k3 domain).
If I run:
using (DirectoryEntry de = new DirectoryEntry("WinNT://" + Environment.MachineName + ",group", null, null, AuthenticationTypes.Secure))
{
}
it throws an "unknown error" 0x80005000 which apparently means "invalid path"
However querying for comput...
We have a team of developers in India. I will be visiting them for a week at the end of the month. Part of my job while I'm there is to provide them with some training. I've been code reviewing them for almost 2 years so I have a few specific things that I'd like to coach them on. My question to the SO community is this:
What genera...
Curious, what happens when you return keyword this from a struct in C#?
For example:
public struct MyStruct
{
// ... some constructors and properties 1-3
public MyStruct Copy()
{
return MyStruct(Property1, Property2, Property3);
}
// vs
public MyStruct This()
{
return this;
}
}
...
I have this function:
public bool IsValidProduct(int productTypeId)
{
bool isValid = false;
if (productTypeId == 10 ||
productTypeId == 11 ||
productTypeId == 12)
{
isValid = true;
}
return isValid;
}
but I'm wondering if there's an easier way to...
Hello,
i built a service with a custom operation selector, the selector simply looks at a specific element in the message body ( and ignores the action) to specify which method to call on a contract.
This works fine, and i can see that the server code is being invoked now, however the client throws an exception saying that the action o...
Providing Synchronous and Asynchronous versions of Method in c# asks how to provide an async version of a method.
One of the answers suggests that class library developers should avoid providing the async method, if possible, based on the single responsibility principle.
Is this true?
Should I NOT provide async versions of methods? ...
As far as I can tell i'm doing everything by the book, but the .NET client is simply not sending an authentication header when making requests to my (PHP) SOAP Web Service. I have verified this by logging the raw post data at the PHP end of things and .NET never sends any auth headers.
This is the code I am running before making calls o...
Hi,
I get child properties of an object with this code,
PropertyDescriptorCollection childProperties = TypeDescriptor.GetProperties(theObject)[childNode.Name].GetChildProperties();
think that "theObject" variable is a TextBox and I try to set TextBox.Font.Bold = true;
I use this code for main properties and it works when I customize ...
I'm implementing generic, persistent .NET collections based on top of the ESENT database engine (using the ManagedEsent interop layer). So far I have been focusing on classes that exactly mimic their System.Collections.Generic counterparts, except that they take a path in the constructor indicating where the database should go. Code like...
I am having a bad directory day. :)
Could someone tell me what is wrong with this?
groupName = "Monkey";
...
using (DirectoryEntry directoryEntryObject = new DirectoryEntry("WinNT://" + Environment.MachineName, "", "", AuthenticationTypes.Secure))
{
using (DirectoryEntry group = directoryEntryObject.Children.Add("CN=" + groupName....
Hi guys
I have the following:
[ServiceContract]
[ServiceKnownType(typeof(ActionParameters))]
[ServiceKnownType(typeof(SportProgram))]
[ServiceKnownType(typeof(ActionResult<SportProgram>))]
public interface ISportProgramBl
{
[OperationContract]
IActionResult<ISportProgram> Get(IActionParameters parameters);
}
When I run the ...
I cannot figure out how to convert this code from C# to VB.net. It says - Argument not specified for parameter ‘y’ in the calling code below.
Any suggestions?
Thanks
Calling CODE:
list.Sort(Utility.CompareContactListsBySortOrder) - error here in VB
CODE:
/// <summary>
/// Defines the compare criteria for two Contact List...
I have an application right now that starts a process, then opens a file associated with that process (system.diagnostics.process.start("WM.exe")), however, the way they save, there is a window within a window. It's like in photoshop cs3 when you have many windows within the big window of the application. Right now I use an api call to f...
I've got a problem I can't find any solution for. I have a textfile containing Serialized objects. I need to extract that data. I have the code of class that was used to serialize and the entities but not the original assembly.
I can't deserialize this because the serialization class wants the exact same assembly to deserialize as the o...
I need to expose room availability information from a web service that will be consumed by a number of other applications. The availability information is stored within Exchange 2003, and can be viewed using Outlook 2003/2007 today.
What API or Web Service (if available) should I be using to get to this information? I imagine that I cou...
This may appear to be a duplicate of this question, which asks "What’s the difference between SortedList and SortedDictionary?" Unfortunately, the answers do nothing more than quote the MSDN documentation (which clearly states that there are performance and memory use differences between the two) but don't actually answer the question.
...