|
Hi,
I am having visual studio 2005 .net version 2.0
I want to use json.
I want to convert a json string to an object
how to do that?
Besides... in other new versions why it is so complicated doing that... or too many lines of code... ?
why isn't like PHP where just one function does all the magic?
http://vikku.info/ Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Did you bother to search? This article[^] was about the third hit doing a search for exactly your post title.
|
|
|
|
|
ah... the problem is i dont know c# at all.
but i know to do socket programming.
I started to learn c# by doing socket programming.
Since i had used visual basic 6.0 extensively with win32 api's it wasn't much hard to use c# but still i am not sure of some generics or what a delegate is for.
Anyway for me what i want is all this
I make a request to my server.
it will give a json string and i want to parse it and use it in my window app.
Thank you
|
|
|
|
|
As Bob Janova just kindly pointed out to you: CodeProject is your friend, and a search on JSON will lead you to many resources here.
I particularly recommend you look at Mehdi Gholam's brilliant JSON article: "fastJSON"[^], which is being frequently updated and improved.
best, Bill
"Anyone who shows me my 'blind spots' gives me the gift of sight." ... a thought from the shallows of the deeply shallow mind of ... Bill
|
|
|
|
|
Hi,
I have added one of my older project(both created in visual studio 2010 ) and now wanted to use can any one help me.
as my older dll has lot of cs files and i need to use them in my new project.
In brief older dll contains win form contents please help me!!!
|
|
|
|
|
you can use using key word to use that dll in the project.
|
|
|
|
|
It is not clear what you are asking. Do you want to use the old files in a new project? Ok, add them to the project. Do you want to use the old assembly? Add a reference to it in the new project.
No comment
|
|
|
|
|
After adding reference to the Project ,you can goto View Menu & then select the Object Browser and refer which DLL you included as Reference in the current project.Incase you need to use any class that are available in the DLL ,create an instance of the class in the code either by defining the namespace (eg : using {Namespace} or directly refering {Namespace}.Myclass =new {Namespace}.Myclass();
|
|
|
|
|
Can you rip all the .cs file and logic(from the form) and create a separate assembly? You can add a reference to this assembly and use it in your main project.
|
|
|
|
|
|
Actually, you can create an instance of a type without ever calling its constructor.
For value types that is trivial, but even instances of reference types can be created without ever calling their constructor. With, for example, GetUninitializedObject[^].
|
|
|
|
|
+5 Fascinating revelation, that ! I'm trying to imagine a scenario where using that method would be required or optimal.
best, Bill
"Anyone who shows me my 'blind spots' gives me the gift of sight." ... a thought from the shallows of the deeply shallow mind of ... Bill
|
|
|
|
|
The documentation gives a big clue: if you are doing deserialisation, you need to have an instance to deserialise data into, but you don't want to go through the construction phase because you want to directly set the state of the object and so any effort the constructor goes to is wasted effort.
|
|
|
|
|
12.No advertising or soliciting
|
|
|
|
|
Hi all! I am outputting text on controls for printing. I changed the font to "Times New Roman", a size of 12.0f. After printing I noticed there were jaggies in the texts. A look at the text on the controls also reveal some jaggies. After reading about the problem, I learnt it can be solved through Anti-Aliasing and Interpolation.
Well, I really do not have any idea about Anti-Aliasing and Interpolation and how to solve these jaggies problems. How do I set the smoothing mode for the control? Since it requires a Graphics object, do I have to create a Graphics object from the control and set the smoothing mode before setting the text, or how?
A little tutorials and guidance will really help me a lot. Thanks in advance.
|
|
|
|
|
Hi, The scenario you describe here is one where you are using DrawString in a Paint EventHandler to overlay text on top of Controls; and then, printing ?
Do you see the same type of jaggies if you switch to another serif font ? If you go up to, say, 18 points in font size, still see the jaggies ?
Have you experimented with TextRenderingHint settings in the Paint event like: see MSDN:[^]
e.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit; Or, if using a ClearType font:
TextRenderingHint.ClearTypeGridFit;
"Anyone who shows me my 'blind spots' gives me the gift of sight." ... a thought from the shallows of the deeply shallow mind of ... Bill
|
|
|
|
|
Hello everyone,
i want to use curve line interpolation in order to draw smooth curve line through a collection of points, i tried to use MSchart but it only use Spline algorithm and sometimes it's not smooth. is there other solution, or is it possible to draw curve lines using other algorithm on MSchart that MSchart doesn't provide, so i can get benefit of the Component properties.
thanks a lot
|
|
|
|
|
You can do custom painting on a chart in its PostPaint event. Alternatively, you can calculate the data for the interpolated line and add it as a series.
|
|
|
|
|
Hi, any ideas on how to solve this problem?
double.IsNaN((NC / (Math.Pow(NX, 0.5) * Math.Pow(NY, 0.5))))
returns true when the visual studio debugger is showing valid values of the doubles NC, NX, and NY (e.g. 1, 2, and 2 respectively)?
Thanks, stegzzz
Using C#, VS2010 Professional, .Net Framework 3.5
|
|
|
|
|
I've just run it and it's outputting false. How have you declared NC, NX and NY - I tested it with double and int and it returned false in both cases.
|
|
|
|
|
Hi, NC, NX, and NY are locals with values arrived at by calling functions C and L
double NC = C(X,Y);
double NX = L(X);
double NY = L(Y);
double.IsNaN((NC / (Math.Pow(NX, 0.5) * Math.Pow(NY, 0.5))))
now returns true, for example when NC=1, NX=NY=2, as shown in the debugger. I should stress that these are not the only values of NC,NX, and NY which produce this strange result, it happens on a range of different (and apparently valid values) and not consistent - I only get the problem on some evaluations so I guess there is something outside the code presented here but I really have no idea where to start to look!
stegzz
|
|
|
|
|
Change it to:
double NC=1;
double NX = 2;
double NY = 2; When I ran this, the NAN check returns false.
|
|
|
|
|
Yes, this works as you say, so I suppose this points to the conclusion that the values shown in the debugger are not the ones which are being used when IsNaN returns true.
How can I work out what values are actually being evaluated and why doesn't the debugger show them?
|
|
|
|
|
Use System.Diagnostics.Debug.WriteLine and write the values to the output window.
|
|
|
|
|
Math.Pow(a, b) gives NaN if (but not only if) a is less than zero but not NegativeInfinity and b is not an integer and not infinite.
Which means, in this case, that if one or both of NX or NY are less than zero but not NegativeInfinity, you get a NaN.
NC can make it NaN if NC=NX=NY=0.
And of course the entire thing will be NaN if any of the inputs are NaN.
The values shown by the debugger must somehow be wrong.
|
|
|
|