if I use two dlls? Again I have the same problem. Think of a programmer or business who sells dlls (my case) and sells more than one to the same client.
inthiscase, from Main I can reference the global space of the first dll (not a good solution), but from the second dll I can not. I do not know how to refer from dlls to a common global space from Main, because I can not do without the global variables since many functions use them constantly. Seriously c# does not have a global space and Microsoft closes the topic with a brief patch That does not solve this problem? Can not be.
That does not sound right. It seems to me that you are trying to make things much more complicated than they need to be with this. Whatever purpose this class serves, you can only have it in one place, either in the DLL or in the EXE part, not in both.
I am trying to retreive data from a webpage with a label saying "export". The data is partially showing on the screen, if I manually click on "export" a window comes up and ask to save, save as, or cancel. I then save all data to my computer as a csv file. However when trying to get the data using c# I get the code behind "export" and not the data, code starts out as "".
I am using the following code:
WebClient webClient = new WebClient();
webClient.UseDefaultCredentials = false;
webClient.Credentials = new NetworkCredential(strUsername, strPassword);
webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
*note url is for "export".
Can someone please point me in the right direction.
Any help will be greatly appreciated.
Thanks in advance.
One thing might be happening here is that the website expects you to reach to file from the page where the button is. Can you add appropriate (that page's URL) referrer header to your request and check?
The following is the website:
"http://finviz.com/screener.ashx?v=150&ft=4" however you have to pay for the service to get data, which will be "http://elite.finviz.com/screener.ashx?v=150&ft=4".
Find the button export the url on that is "http://elite.finviz.com/export.ashx?v=150&ft=4"
This is the actual url I use then add or don't add ".csv".
if I enter the url in my browsers command line, the file is downloaded, but when I use c# I get html code.
You have a global variable speachsynthesizer (ss) that you configure on button1 then on the actual record button4 you create a new LOCAL variable speachsynthesizer of the same name (ss) that you do not configure but use that to speak the text.
The Record button is used to save text inside textBox!
I have replaced varibles from button1 and button4 with SpeechSynthesizer ss = new SpeechSynthesizer(); as global varible but still not working!!!!
If you now have two lines like this in your code, that's not correct. You only need to declare it once, in the Form_Load. So, you have a member variable called ss (that's a poor choice for a name - why not just call it speechSynthesizer), and in your Form_Load you have ss = new SpeechSynthesizer. That's it - that's the only place you should see the new Synthesizer() call.
Exactly. That's a bug in the language specification of C# which can cause bugs in the software which are very hard to find. Fortunately, ReSharper can issue a warning. And a well designed style guide should suggest different styles for fields vs. local variables.
Last Visit: 31-Dec-99 19:00 Last Update: 28-Nov-23 3:49