PozzaVecia
Posts
-
Getting Data from web : C# failed while Excel works -
Getting Data from web : C# failed while Excel worksI want to download same data from a web page. Using Excel webquery it works, while using C# it doesn't. Here my code:
WebClient webClient = new WebClient();
string page = webClient.DownloadString(a);
System.Net.WebException: 'The remote server returned an error: (403) Forbidden.' Have you any ideas? Thanks for your time
-
Mouse set in the formMouseLocation is it a proprties? of which object?
-
Mouse set in the formGoodmorning, I would like to start my form having the mouse set in the form area (in any position is ok, but in the form) at the start. Is it possible? Thanks
-
Chart ToolTip using #VALX as Key of a dictionaryI created a chart showing a data serie including X value year and Y value MarketValue of my cars' collection. Suppose I have a dictionary containing car model and car year. Using the mouse on the chart I need to visualize X and Y value and the name of car model. To show X and Y I use the following code:
chart1.Series["CAR"].ToolTip = "Year: #VALX MarketValue: #VALY"
If I want to show also the model name, any idea?
Dictionary D = new Dictionary();
D.Add(1982,"Cinquecento");
D.Add(2000,"Espace");chart1.Series["CAR"].ToolTip = "Year: #VALX MarketValue: #VALY Model: "
// here I need to get the model from dictionary associed to the year (#VALX) and add itAny idea? Thanks for your time
-
Generic collectionsoky thank
-
Generic collections:)
-
Generic collectionsthanks very useful
-
Generic collectionsThanks a lot, I did a workaround using a syncronized List.. Then I found the following solution
Dictionary d = new Dictionary();
d.Add("z", 1); d.Add("a", 2); d.Add("c", 3); d.Add("b", 4); foreach (KeyValuePair k in d) { Console.WriteLine(k.Key + " " + k.Value); } KeyValuePair i\_item = d.ElementAt(2); int myIndex = Array.IndexOf(d.Keys.ToArray(), "a");
-
Generic collectionsI did the same as a workaround solution... thanks a lot
-
Generic collectionsthanks you are right sorry. Basically I need to find the index from the key and viceversa. How can I find the index related to the key "3", from the dictionary. It should be 2
-
Generic collectionsKeyValuePair i_item = d.ElementAt(2); // if d is a Dictionary it is not possible
may be I was not clear I can't get item from index value. For example I need the second element How can I ask the Dictionary the second element? The dictionary is an unsorted collection
-
Generic collectionsI need to use a generic collection of keyvalue pair. I need thr folloeing: 1) should be generic because my values are a customized class 2) iterating should keep the order in which I added Items 3) I should be able to find the index of the element 4) I need access via Key A dictionary is ok for 1,2,4 but not for 3 SortedList and SortedDictionary are ok for 1, 3, 4 but not for 2. If I create a
List
it is ok for 1,2,3 but not for 4 ( I mean not directly)
//Dictionary d = new Dictionary();
SortedList d = new SortedList();
d.Add("z", 1);
d.Add("a", 2);
d.Add("c", 3);
d.Add("b", 4);foreach (KeyValuePair k in d) { Console.WriteLine(k.Key + " " + k.Value); }
// output: a 2 b 4 c 3 z 1
// but i need to preserve the order in whicth I added.
// I need output: z 1 a 2 c 3 b 4
// using Dictionary I preserve the order but how can select item using an index?KeyValuePair i_item = d.ElementAt(2); // if d is a Dictionary it is not possible
Any suggestion? Thanks for your time
-
Null array in a dictionarythanks in this case I see you need a "hard coded" value 0.0. Is it possible to say "if null just skip it"?
-
Null array in a dictionaryThanks in this way I'm not able to find the Max value of first element
var ks = d.Max(v => v.Value[0]);
I didn't clarify before this port sorry
-
Null array in a dictionaryI need to instatiate a dictionary accepting null as value, but I have a syntax problem:
Dictionary d = new Dictionary()
d.Add("a", new double[2]{100,102});
d.Add("b", null);
d.Add("v", new double[2] { 99, 101 });;Is it possible to do it?
-
Flashing formvery very useful!!! thanks a lot
-
Flashing formIs there a way to make a Form flashing in c#. First idea is to use a timer changing form color. Is there a more elegant way? Thanks for your time
-
User defined functions for Excel 2010 in .NET: args linked to cells don't workQuote:
Nope. It works fine on Office 2007 (32-bit) running on Windows 7 64-bit.
Yes I tested the same Excel 2007 32bit with Windows 7 64bit is fine.. I have the problem with Excel 2010 32bit with Windows 7 64bit. I thought It was a problem of bit because if I type argument in a cell the UDF does't work (I thought It was a bit conversion problem). While if I directly write arg in function it works. I also create a function with no args and it works (Excel 2010). So the problem is linked to reading arg from other cells. Very strange
-
User defined functions for Excel 2010 in .NET: args linked to cells don't workI have Windows 7 64-bit and Excel 2010 32bit I have the following question: I created an user defined functions for Excel in .NET according to the code http://blogs.msdn.com/b/eric_carter/archive/2004/12/01/writing-user-defined-functions-for-excel-in-net.aspx[^] I'm using now MultiplyNTimes in my Excel 2010 spreadsheet. if in the cell A1 i type =MultiplyNTimes(2,3,4) i get the correct results (162) if in the cell A1 i type =MultiplyNTimes(B2,3,4) and I type 2 in cell B2, then I get #VALUE! Basically my UDF can't accept a link to a cell as argument... can this bug be connected with 64 bit of Windows? (note thae using the same OS with in 2007 works fine!) not sure I'm clear. Have you any suggestion to fix this bug? Thanks for your time