|
You want to program this yourself?!?
Use VNC. Messing around with it in a private network is really funny.
|
|
|
|
|
How to get that any Arrow key is pressed.
|
|
|
|
|
Override the KeyPress, KeyDown, or KeyUp event (as you need) in your form class, and check the KeyValue values of KeyEventArgs.
Peter Molnar
|
|
|
|
|
I m sorry are you asking me to use in Key down event
<br />
if(e.KeyValue == Keys.Down)
i have tried every mathod that i know to get ArrowKeys but not able to do so. Please help me.
|
|
|
|
|
Ok Problem Solved. For others Info how i able to do this
<code
protected override="" bool="" processcmdkey(ref="" message="" msg,="" keys="" keydata)
="" {
="" switch(keydata)
="" case="" keys.down:="" label1.text="Hello" ;
="" break;="" and="" for="" other=""
="" }
="" return="" base.processcmdkey="" (ref="" keydata);
="" }
}
<="" code="">
havn't find any other mathod so if you know any other mathod i really would like to read. Thanks in advance
|
|
|
|
|
you should cast the Keys enum to int, so it will compile
private void OnKeyPress(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyValue == (int)Keys.Down)
{
...
}
}
Peter Molnar
|
|
|
|
|
Hey all,
I'm getting a strange "Index (zero based) must be greater than or equal to zero and less than the size of the argument list" exception thrown when I trigger an event (atleast that's where I've tracked the problem to). This seems very strange to me since I'm doing no idexing here. I'm making a WebRequest, retrieving an XML document and parsing / serializing it to an object, then triggering an event to notify my Window.Form app that the data is available for display, however when I call my event passing it my custom EventArgs class I get the above exception.
I've played around a bit passing my EventArgs class different things and if I pass it a null (ie don't populate any of the data within it through a default cuonstructor the exception doesn't occur (this is of course useless to me caus I need the app to get this data). I've pretty much run out of ideas here ... could this be a known bug and I'm just late to the game? Has anyone else run into this? Am I missing something obvious (though this case is embarasing it's usually easily fixed).
I'm not sure posting any code will be very descriptive because it's distributed over so many classes, but some snipits follow:
// Delegate
public delegate void CMNMatchDetailsEventHandler(object sender,
MatchDetailsEventArgs a);
// EventArgs holding needed class
public class MatchDetailsEventArgs : EventArgs
{
public MatchDetails Response;
public MatchDetailsEventArgs(MatchDetails r)
{
Response = r;
}
}
.
.
// getting XML doc from web and serializing (using inherited method from an abstract class)
MatchDetails resp =
(MatchDetails)ExecuteGET(url, typeof(MatchDetails));
// calling event :: Passing my populated class to the EventArgs for my front end app.
MDetails(this, new MatchDetailsEventArgs(resp));
If I replace the "resp" class/parameter with null the exception does not occur, though the "resp" class contents are fully populated (I've dumped it to the console both before serializing the XML and after, everything appears to be intact)
I'm at a loss here.
Any help would be awesome.
Thanks in advance
- flip
|
|
|
|
|
Im over 90% sure that the class handling the event is raising the error. To track down the error source you should enclose the part where you trigger the event with a try catch block and look at the stack trace of the catched exception:
<br />
try {<br />
MDetails(this, new MatchDetailsEventArgs(resp));<br />
} catch (Exception exc) {<br />
Console.WriteLine(exc.StackTrace);<br />
}<br />
From the given output you will exactly get the source of the error.
|
|
|
|
|
Thanks for the quick respons Robert.
I probaly should have thrown in the stack trace, caus that might have been helpful. My debugging skills aren't what they should be but they're getting there.
Your post led me right to the source of the problem ... A+, Thank You and yet again I'm humbled
- flip
|
|
|
|
|
|
I would like to make changes to files that are stored in a specific windows directory for my application, and I know that it would require the usage of the foreach loop, but I do not know how to apply the syntax of how to access the files in the directory.
Here is what I think is the correct syntax. Please correct me. The error message is that it "cannot convert type string to System.IO.File".
using System.IO;
dirDirectory = "C:/directorypath/";
foreach (File fileName in Directory.GetFiles(dirDirectory))
{
fileName.
... processing (need to access the properties of each file)
}
Would appreciate assistance in establishing the correct syntax. While I realize that the foreach loop requires a specific file/control to evaluate and a collection of files/controls to follow the IN word, it doesn't seem to work here. It would seem to me that the GetFiles() method is a collection and should work. Why doesn't it?
The typical syntax is:
foreach (Control control in this.Controls)
{
... processing
}
|
|
|
|
|
It doesnt work because Directory.GetFiles return a string array and not a collection of File objects.
You have the following options:
1:
<br />
foreach (string fileName in Directory.GetFiles(dirDirectory)) {<br />
}<br />
2:
<br />
foreach (FileInfo fileInfo in new DirectoryInfo(dirDirectory).GetFiles()) {<br />
}<br />
|
|
|
|
|
Wow!!! Thanks, Robert Rohde. It worked!!! I prefer the second option because it more clearly demonstrates that the files are files and that the directories are directories as opposed to simply strings. I appreciate your assistance.
|
|
|
|
|
how can i use Sqlite with C#?
|
|
|
|
|
Google is your friend:
http://www.google.de/search?hl=de&q=sqlite+.net&btnG=Google-Suche&meta=
|
|
|
|
|
Hello,
do anyone know, how to create an ms installer for application1 when I click a button in an application2.
Please help,
Thank u
|
|
|
|
|
I am using a third party socket component for communication. My program should act as a client and i need to connect multiple hosts using this component. Can anyone suggest how to achieve this in c#.
|
|
|
|
|
We are able to connect and access emails from outlook, using out C# program.
However, we are getting this annoying popup from outlook asking for permissions.
Appreacite if someone could help supress this window.
Thanks in advance.
Srinivas
|
|
|
|
|
You have to use native code (or wrap the native code) for Extended MAPI, which is documented in the MSDN Library[^]. Any MAPI clients cause Outlook to prompt for permission because of malicious code abusing the API. There's no way to circumvent it, otherwise it wouldn't be very secure, would it?
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thank you. Appreciate the response. It means we need to move to extended MAPI.
Srinivas
|
|
|
|
|
I have some problems in video broadcast. An error message popup from windows media player - "server not available".
Here are some of my code:
SERVER:
// Create a WMEncoder object.
WMEncoder Encoder = new WMEncoder();
// Retrieve an IWMEncBroadcast object.
IWMEncBroadcast BrdCst = Encoder.Broadcast;
// Set the port number.
BrdCst.set_PortNumber (WMENC_BROADCAST_PROTOCOL.WMENC_PROTOCOL_HTTP, 8080);
// Create an IWMEncSourceGroupCollection object.
SrcGrpColl = Encoder.SourceGroupCollection;
// Create an IWMEncSourceGroup object.
SrcGrp = SrcGrpColl.Add("SG_1");
// Create a video and an audio source object.
SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcVid = (IWMEncVideoSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
// Specify the path of the source file.
SrcAud.SetInput("C:\\temp/poor_mark.wmv", "", "");
SrcVid.SetInput("C:\\temp/poor_mark.wmv", "", "");
// Choose a profile from the collection.
IWMEncProfileCollection ProColl = Encoder.ProfileCollection;
IWMEncProfile Pro;
for (int i = 0; i < ProColl.Count; i++)
{
Pro = ProColl.Item(i);
//MessageBox.Show(Pro.Name);
if (Pro.Name == "Windows Media Video 8 for Local Area Network (256 Kbps)")
{
SrcGrp.set_Profile(Pro);
break;
}
}
// Start the encoding process
SrcGrp.PrepareToEncode(true);
Encoder.Start();
CLIENT:
Player.URL = "http://144.214.61.5:8080";
What're the problems. Please help.
|
|
|
|
|
I posted this before but it got buried. How would I go about manipulating files at the kernel level? I am trying to incorporate file hiding into a project and I can't seem to find any information on the subject. It would work much like Folder Lock which: "locks files on kernel level, Windows Explorer and even real DOS Mode, Works on Windows 2003/XP/2000/NT/Me/98 and all kinds of disk types like FAT16, FAT32, NTFS."
Here is a screen shot of the program folder and where the actual hidden files are located:
http://oxygine.com/Images/show.png
Can someone at least point me in the right direction?
|
|
|
|
|
Ask in C++ forum and post in MS newsgroups (maybe even the DDK section). File hiding and working with the kernel doesn't have much to do with C# anyway.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Anyone ever come across an algorithm for ensuring that text is always in a readable color distinct from it's background?
It seems simple on the surface but the more I get into it the more I hope I don't have to re-invent the wheel.
In the app I'm working on, people can select any ARGB colour for the background of an appointment element on a calendar as a type of quick STATUS type of thing. Unfortunately they can select black and since the text is black it vanishes. I was thinking of auto-adapting the text color to be readable depending upon the background ARGB but it's not as easy as it sounds.
Any thoughts appreciated.
|
|
|
|
|