|
i havnt a clue on how to do it on a pc, i just know that you can...
but ive done it on a router before... are the 2 pc's on a LAN or connecting though the internet?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
It is on a lan. The router is configured to forward port 22 to my computer which is running windows. However, i am running coLinux on the system and it is connected to a virtual network device. Therefore port 22 (SSH) is forwarded to windows by the router, which in turn needs to be forwarded by windows to the coLinux system which resides at 192.168.37.20
|
|
|
|
|
VrIgHtEr wrote: Does anyone have any suggestion how I can do this?
Maybe you could start here?[^]
led mike
|
|
|
|
|
Hello
I am developing a new control based upon a button. In fact it is based upon code for a splitter button I found here.
So far I have updated the class so that multiple images can be assigned to the button. Each time the button is clicked the next image in the list is displayed. If there are no more images left it wraps around to the start. So far all good.
What I am trying to accomplish now is updating the image in response to a user selection on the context menu accessed by clicking the black triangle.
I want this to be automatic within the control. i.e. I don't want to catch the event in the form and handle it that way.
However im not sure how to do this within the control. I tried putting an event handler for the OnContextMenuStripChanged event in the controls code but it never gets called.
Hope that makes sense, any ideas?
Cheers
Rich
|
|
|
|
|
kildareflare,
You need to override the event.
protected override void OnContextMenuChanged(EventArgs e)
{
base.OnContextMenuChanged(e);
}
Make sure when overriding methods, that you always call the base method as well.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
When I try to connect to the Database using C# I get an error that says(provider is not supported or the DataAccessLayer could not be loaded)
I am connecting to Sql Server 2005 using C# 2008.
|
|
|
|
|
mphumeleli wrote: When I try to connect to the Database using C#
Make sure you are using the correct ConnectionString...
|
|
|
|
|
mphumeleli wrote: When I try to connect to the Database using C# I get an error that says(provider is not supported or the DataAccessLayer could not be loaded)
How are you trying to connect to the database. Show us the code.
|
|
|
|
|
Use a more meaningful subject line, please.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
If I use the 256 textboxes on the GUI, I noticed it loads a bit slow due to many components. is there a better and efficient way to display the 16x16 blocks? similiar idea as the multiplication table.
Listview is best way to do it?
and Occasionally I would be able to select the row/column so I can highlight the row/column.
Any suggestion?
|
|
|
|
|
Blubbo wrote: Listview is best way to do it?
Yes
|
|
|
|
|
suppose i have one sdi form and suppose there is one button called exit. when user will click on exit button then Application.Exit is called and my application end.......but the problem is when we finish our programm just by Application.Exit then program end but the process still show in process dialog....i mean after ending the program if someone just press Alt+Ctrl+Del then a task manager come and in the task manager dialog if u go to process tab then u can see the process is still running......so just tell me why the apps shows in process dialog.....plzz tell me how to stop my process in such a way that it will end and as well as it will not show in process dialog.
plzz give me the suggestion and sample code.
Thanks.
tbhattacharjee
|
|
|
|
|
The most common symptom for this is that you have another thread running. Make sure you stop all threads when you close your program.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
I suppose, you have started another thread in the background of the application.
Make sure to stop all threads used within the application before the Application.Exit() is called.
|
|
|
|
|
I was using This Code...
//---Code---//
ManagementObjectSearcher mySearcher = new ManagementObjectSearcher("root\\WMI","SELECT * from Win32_TemparatureProbe");
foreach (ManagementBaseObject obj in mySearcher.Get())
{
if (obj == null)
{
label1.Text = "didn't find";
}
else
{
label1.Text = obj["Accuracy"].ToString ();
}
}
//---Code End---//
But No RESULT.
Plz me code for How to Get HardWare Information from CPU like Temparature,Voltage,FanSpeed. code in .Net
Thanks
Madhu.T
|
|
|
|
|
WMI wont get you there. I dont know what will either though.
|
|
|
|
|
You get much better results when you spell Temperature correctly
ManagementObjectSearcher mySearcher = new ManagementObjectSearcher("SELECT * from Win32_TemperatureProbe");
Also, maybe see the Win32_Processor WMI class for voltage info.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm continuing my quest to get rid of magic strings to identify members. This is so the compiler can check more deeply and to avoid problems with obfuscators.
I've come up with this, but it seems more like a kludge than a hack. Has anyone got any bright ideas?
Thanks
Nick
class TestFirstClassMembers
{
static readonly Module sModule = Assembly.GetExecutingAssembly().GetModules()[ 0 ];
internal static void Test()
{
Trace.WriteLine( "\n\nTestFirstClassMembers" );
var mi = new Member( ( Func<Class, int> ) ( o => o.Field ) );
var ml = new Member( ( Func<Class, long> ) ( o => o.FieldLong ) );
var ms = new Member( ( Func<Class, String> ) ( o => o.FieldString ) );
var mp = new Member( ( Func<Class, int> ) ( o => o.Property ) );
var mf = new Member( ( Func<Class, int> ) ( o => o.Function() ) );
var mm = new Member( ( Action<Class, int, string> ) ( ( o, i, s ) => o.Method( i, s ) ) );
}
class Class
{
public int Field = 0;
public long FieldLong = 0;
public String FieldString = String.Empty;
public int Property { get; set; }
public int Function() { return 0; }
public void Method( int i, string s ) { }
}
class Member
{
public Member( Delegate d )
{
MethodBody body = d.Method.GetMethodBody();
byte[] il = body.GetILAsByteArray();
for ( int i = 0 ; i < il.Length ; i++ )
{
switch ( il[ i ] )
{
case 0x6F:
case 0x7B:
{
int token = BitConverter.ToInt32( il, i + 1 );
var m = sModule.ResolveMember( token );
Trace.WriteLine( m.ToString() + ": " + m.Name + " " + m.GetType().ToString() );
}
break;
}
}
}
}
}
----------------------------------
Be excellent to each other
|
|
|
|
|
Nick Butler wrote: I'm continuing my quest to get rid of magic strings to identify members. This is so the compiler can check more deeply and to avoid problems with obfuscators.
I've come up with this, but it seems more like a kludge than a hack. Has anyone got any bright ideas?
What are you trying to do? Specifically with the MethodBody.
|
|
|
|
|
Thanks for replying leppie. I was hoping you might help.
I want to specify any member of a class in a way that the compiler can check. For instance, this is not acceptable because it will not work if you rename the field, or even "Find all references".
var fi = typeof( Class ).GetField( "Field" );
So, I thought I could use a lambda which I can pass as a delegate that the compiler can check. The code in the lambda must be just a call the the member you want to specify. The only way I can think of to get at the code is to look at the IL.
I may well be barking up the wrong tree, but I can't think of a neater way...
----------------------------------
Be excellent to each other
|
|
|
|
|
Nick Butler wrote: I may well be barking up the wrong tree, but I can't think of a neater way...
I think I understand (but not really completely), but your way is neat within the context
|
|
|
|
|
Thanks.
I think what I'm trying to do is make all members first-class objects like in Smalltalk. Maybe I should just change language...
----------------------------------
Be excellent to each other
|
|
|
|
|
Maybe
|
|
|
|
|
I want to create a program that launches when I hit some combination of keys e.g. <ctrl> + 1.
My goal is to let a copy operation <ctrl> + c to be pasted into a file for e.g. c:\file1.txt no mater from which program the user is copy information from.
_____________________________
...and justice for all
|
|
|
|
|
d00_ape wrote: let a copy operation <ctrl> + c to be pasted into a file
I think you are trying to steal sensitive information with out informing the user.
*jaans
|
|
|
|