C# 4.0 has a lot of new major features such as dynamic type, covariance and contravariance, named arguments etc.
But C# 4.0 contains new minor (but useful) changes such as TryParse method for TimeSpan, Enum, Guid data types, String.IsNullOrWhiteSpace, System.IO.Stream.CopyTo etc.
What other minor and useful features of C# 4.0 can you ...
I have a large piece of text in which there is something simular to this:
!#_KT_#!COMMANDHERE!#_KT_#!
I want, in VB.Net, to get the 'COMMANDHERE' part of the string, how would I go about doing this? I have this so far:
Dim temp As String = WebBrowser1.Document.Body.ToString
Dim startIndex As Integer = temp.IndexOf("!#__KT__#!") + 1
Di...
Does anyone knows if it is possible to define/declare on your own custom attribute a restriction to the field type it may apply on?
There are a flags that do restrict the usage of the attribute:
[AttributeUsage(
AttributeTargets.Property,
AllowMultiple = false)]
Im looking for something like:
UseOnlyOnType = typeof(string)
A...
how do you declare a char* in .net?
...
I've got a WCF service that offers many lists of items of different types. The lists can be changed on the server. Every change has to be published to all clients to make sure every client has an up-to-date copy of each server list.
Currently I'm using this strategy: On login, every client receives the current status of every list. On e...
I working in a activex control using .net for load it in a ie website. I need read a jpeg 2000 file but i don't want use a 3rd party dll because this will cause dependencies or embedding it make my dll very big. Anyone have idea where i can find a class .cs for embedded on my project, i need only read file, no write only read.
...
A colleague told me that using the following method:
string url = "SomeURL";
string ext = "SomeExt";
string sub = "SomeSub";
string subSub = "moreSub";
string Url = @"http://www." + Url +@"/"+ ext +@"/"+ sub + subSub;
is not efficenet (takes more resources) and it is preferred to use the following method:
string Url = @"http:...
I'm starting with .NET CF WinForm application and I have some experience with .NET WinForm.
What is better for UI, form for each dialog or one form and changing user controls on that form? I'm asking for that, because screen on mobile devices are very small and I designed more then ten different screens for my application.
...
Situation: Automatically generated memebers, such as MenuStrip items, have their (automatically generated) names based on the text entered when the item was created. My most common situation is creating a menu-strip and adding menu-items by entering their text (using the graphical designer).
Since my GUI is in Hebrew, all these members ...
i have a method that looks like this:
private double GetX()
{
if (Servings.Count > 0)
{
return Servings[0].X;
}
if (!string.IsNullOrEmpty(Description))
{
FoodDescriptionParser parser = new FoodDescriptionParser();
return parser.Parse(Description).X;
...
I am looking for ways to store data in a windows form application in .NET.
I want to make the input data of a system persistent, so when I close my program and open it again, the data is retrieved.
Which ways are of doing this besides creating a linked database?
Examples are gladly appreciated
regards
...
i use a treeview to display files and folders like Windows Explorer. it has a NodeMouseClick event but sometimes when i click +, this event doesn't fire.
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
MessageBox.Show("node mouse click");
}
can anyone explai...
after clicking on button in asp.net application process.start() runs edmgen tool with arguments. And I catch error :
var cs =ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
string myArgs="/mode:fullgeneration /c:\""+cs+"\" /project:nwd /entitycontainer:SchoolEntities /namespace:SchoolModel /langua...
I work mainly on Windows and Windows CE based systems, where CreateFile, ReadFile and WriteFile are the work horses, no matter if I'm in native Win32 land or in managed .Net land.
I have so far never had any obvious problem writing or reading big files in one chunk, as opposed to looping until several smaller chunks are processed. I us...
Hi,
I have a theoretical question about the .net framework.
As I see it Microsoft gave us bunch of technologies for different layers.
We have the ADO.NET and with the more improved Entity Framework for Data Access.
And ASP.NET for WEB UI. And even WCF for Facade and SOA.
But what in the middle, what do we have for the Business Laye...
how to get from such string ' name1{value1,value2};name2{value3}; ... nameN{value12, valueN} '
Array or arrays in such form: Array = {string, int};{string, int};{string, int};
like this:
{
{ name1 ; value1}
{ name1 ; value2}
{ name2 ; value3}
...
{ nameN ; valueN}
}
in C# (.net)?
...
I'm trying to use Ajax Control Toolkit's Autocomplete extender with a WCF Service.
This question is almost what I'm looking for, one of the answers points to a tutorial but I can't get it to work.
In my solution I have a web form application project and a WCF service library project.
One of the properties of the Autocomplete extender ...
Why isn't ASP.NET MVC 2.0 part of the .NET 4.0 BCL ?
...
Hi guys
I'm new to WCF and am trying to get some ideas I have off the ground.
Basically I have a web WCF Application project with the following in its web.config:
<system.serviceModel>
<services>
<service name="WcfService1.ServiceContract.IDirectorySearchService" behaviorConfiguration="defaultServiceBehavior">
...
When spiking on how something works or when my unit test behave in an unpredictable manner I usually have to drop into debug mode. 99% of my time in debug mode is spent checking the values of fields on objects to verify its state.
I already have log4net set up, it would seem that if I could easily add a line of code to log out the st...