|
|
Mr. Hot Thought -
Can you provide a correct subject.
|
|
|
|
|
I have a simple program. It has one Form called frmMain, and another Class called Poker. I have the following snippit routine below. The name 'Color' does not exist in this context. What do I need to do to make this work?
public void Results(Label lbl_1)
{
frmMain Form1 = new frmMain();
lbl_1.ForeColor = Color.Yellow;
Form1.lblWinnings.Text = "100";
}
|
|
|
|
|
yogi_bear_79 wrote: The name 'Color' does not exist in this context.
Include using System.Drawing; at the top of your source module.
|
|
|
|
|
|
When you get this error if you hover your mouse over the offending item, you should see a rectangle appear under the rightmost letter of the word. Moving the pointer over this rectangle changes it to a drop-down, offering solutions. Simply select the 'using System.Drawing' one and bob's-your-uncle.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
Hi.
I am about to program a piece of software which contains a single server, and about 20-40 clients.
All parts can be spread out on a lan, or on a wan.
The server shall be able to broadcast/multicast to the clients in some way, and the clients should be able to fetch information from the server.
There are about 30 kinds of information which has to be fetched/broadcasted.
Question is, how to solve this general problem in the most elegant way?
I would be happy if i could avoid switches in the client/server end to check what kind of information i received, or make my own kind of application layer protocol to check it.
I had a look at remoting, like RMI in java, but that seems to be a very bad idea over WAN because of firewalls and such.
Do you have any insight in possible solutions for this?
Thanks alot 
|
|
|
|
|
|
Hi,
I'm trying to process the HTML source code from a certain web page.
This web page has security enabled, using a Username & a password.
I'm using the following method to try to access the page:
public static string GetHtmlPageSource(string url, string username, string password)
{
WebClient wc = new WebClient();
wc.Credentials = new NetworkCredential(username, password);
try
{
using (Stream stream = wc.OpenRead(new Uri(url)))
{
using (StreamReader reader = new StreamReader(stream))
{
return reader.ReadToEnd();
}
}
}
catch (WebException e)
{
return e.ToString();
}
}
This doesn't work however, I seem to be stuck at the logon page. I'm not able to pass the user security.
Anyone has an idea?
|
|
|
|
|
Do you not think that the site owners put the security there for a reason?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Yes I do, it's to prevent unauthorised access to the page...
However, this is a Web page that exists on the intranet of our company network.
It displays certain measures which we want to display on a Dashboard application.
The idea is to have an overview of these values at the blink of an eye (the dashboard will be projected on a whiteboard).
Normally, we would use a read account on the database for this, but (since the database is being managed by the Netherlands and I am a Belgian employee) the Netherlands are refusing to give us a read account.
So this is the only way how we can succeed in building the dashboard.
|
|
|
|
|
Dimitri Backaert wrote: Normally, we would use a read account on the database for this, but (since the database is being managed by the Netherlands and I am a Belgian employee) the Netherlands are refusing to give us a read account.
Does the chairman of the company think this is a good thing?
|
|
|
|
|
Doncha just luuuv office politics?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: Doncha just luuuv office politics?
I just wonder why the Dutch don't trust the Belgians? 
|
|
|
|
|
This might all seem very funny, I know, but it doesn't solve my problem....
Concerning the chairman, A request has been sent by my manager.
But this might take a while to achieve (office / political war between Belgium / Netherlands).
The main reason why the Netherlands are unwilling to release information, is that they were formerly the only group that maintained all the ICT infrastructure for the whole Benelux company group.
However, since the beginning of 2009, Belgium and Luxemburg splitted from the Netherlands, and created their own ICT division.
I think it's some sort of Job Protection...
Politics, money, it's all involved.
And it's - excuse my language - a real pain in the ass...
|
|
|
|
|
Dimitri Backaert wrote: This doesn't work however, I seem to be stuck at the logon page. I'm not able to pass the user security.
Anyone has an idea?
It would seem that WebClient is not recognizing this page
as an authentication request. You will most likely have to
manually format the correct response and send it to the server.
I would use "WireShark" to trace a manual session with the server. This should let you see what the server expects for
an authentication response.
James Johnson
|
|
|
|
|
James,
Thank you for your answer.
This could do the trick.
I'll try it out.
I already was thinking about changing the HttpWebRequest in another method, because in my opinion a WebRequest is the equivalent of a GET.
What I need is a POST, so I'm thinking of using an HttpWebResponse...
|
|
|
|
|
Suppose I have a business object '`obj1`' that has property '`P`'.
Let's also assume that I have a list of business objects: '`List<BussObj> list`' and each BussObj object contains 2 properties: '`A`' and '`B`'.
This list is bound to combobox: `combobox.ItemsSource = list;`.
I would like to specify binding (in C# code) that would bind combobox.SelectedItem.B to my obj.P. How to do it?
I tried something like that but it does not work:
Binding bind= new Binding("B");
bind.Source = obj.P;
comboSubject.SetBinding(ComboBox.SelectedItemProperty, bind);
Thank you in advance for any help
|
|
|
|
|
Hello,
I am Developing a C# WINDOWS application. In my Application i need to call a cpp dll which returns the list of Drives
connected to the PC.
The Function is "int GetDeviceDiskName(char**);". I can get all the drive names in my vc++ application after i call this
function.
char *device[10];
for(int i = 0; i < 10; i++)
{
device[i] = new char[10];
memset(device[i],0,10);
}
int nRes = GetDeviceDiskName(device);
device returns all the USB's attached to the PC.
But I have Trobule calling this function in C#.Net.
In my c# code i have declared the function in this manner,
[DllImport("../../Hanlin.dll", SetLastError = true, CharSet = CharSet.Ansi,CallingConvention = CallingConvention.Cdecl)]
public static extern Int32 GetDeviceDiskName(String[] deviceName);
In c# i tried to call this function in this way,
char[] deviceName = new char[10];
int nStatus = GetHanlinDeviceDiskName(ref deviceName);
But I get Error as "Additional information: Attempted to read or write protected memory. This is often an indication that
other memory is corrupt."
Can some one help me how to call this function.
In the Dll file the "device" array will be updated in this way,
if(bDiskFound)
{
device[cnt][0]=cDiskID;
cnt++;
}
modified on Thursday, October 8, 2009 9:09 AM
|
|
|
|
|
Marshaling char** parameters isn't easy, and probably not worthwhile. I would recommend any of three alternatives:
1. implement the functionality directly in C#
2. call an existing native function of a lower level, e.g. dealing with just one device at a time (pass a StringBuilder to be filled)
3. pass a StringBuilder instance with sufficient capacity, and store the device names in there, separated by some character, say a semi-colon; upon return call ToString() and Split(';') on it.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
hi friends
i have a datagridview and i add a column to this datagrid that has a picture(start symbol) i want to write a code that when a user click on the picture in datagridview the picture of that control has been changed
(stop symbol). please tell me a solution and say me what code are usefull for this action
nobody help you...
you have to help you yourself
and this is success way.
modified on Thursday, October 8, 2009 1:32 PM
|
|
|
|
|
hi,
its simple... add following html in the gridview column.
<a href="javascript:void(0);" onclick="ChangePic(this);"><img src="xyz.jpg"/></a>
now add a add following javascript to your page:
function ChangePic(sender)
{
sender.childNodes[0].src="abc.jpg";
}
there are many more ways to do this.
Hope It solves ur problem...
Regards
Atif Ali Bhatti.
|
|
|
|
|
i spoke about a windows application not web application my friend
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
Is the column a bound column, or an unbound column.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|