|
Handle the KeyPress event raised by the TextBox control and check which key has been pressed. Cancel the key press if the user has made an invalid selection.
More information about handling this event can be found here[^].
Paul
|
|
|
|
|
hi assaf,
Use Cool Tips
hope above link solve your current problem & many more
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
How do I call the methods in my .dll files which are compiled using EVC 4.0 and the use them with my SmartDevices application on C#?
Advice?
samuel
|
|
|
|
|
Would P/Invoke help you?
|
|
|
|
|
Awesome I think it might do the trick
|
|
|
|
|
But it is Embedded VC++ DLL. Isn't it?
|
|
|
|
|
how to open .csproj in xml file through C# code and add a file as a link
I want to add CommonFileInfo.cs in more than one project
for this i want to add "CommonFileInfo.cs" file as a link in project.
So I want to open every .csproj in xml file and add this code.
<compile include="..\Projects\CommonFileInfo.cs">
CommonFileInfo.cs
How to do this???
Thanks in Advance
-- modified at 8:28 Saturday 1st September, 2007
|
|
|
|
|
|
Dear friends,
I have Created a windows Service in .net 2005 to find the WMI Classes that are available in a system.
When I invoke this windows service through a web site
I could get all the WMI Classes available in my system.
But it throws an error “Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) “ Like this for the remote System.
Note: I have given the correct User name and Password.
And this same code works fine in windows application,console application and web site for the remote system and local system..
This is the Code:
private string[] GetClassesList(string sIPAddress, string sWMINameSpace, string sUserName, string sPassword, bool bRemoteSystem)
{
int queryClassCount = 0;
string[] aClassList = null;
ConnectionOptions cnnOptions = new ConnectionOptions();
ManagementObjectCollection objClassColl = null;
cnnOptions.Username = sUserName;
cnnOptions.Password = sPassword;
cnnOptions.Authentication = AuthenticationLevel.Packet;
ManagementObjectSearcher searcher = null;
try
{
if (bRemoteSystem)
{
searcher = new ManagementObjectSearcher(new ManagementScope(@"\\" + sIPAddress + @"\" + sWMINameSpace, cnnOptions),
new WqlObjectQuery("select * from meta_class"), null);
}
else
{
searcher = new ManagementObjectSearcher(new ManagementScope(sWMINameSpace),
new WqlObjectQuery("select * from meta_class"), null);
}
objClassColl = searcher.Get();
//aClassList = new string[objClassColl.Count+1];
}
catch (Exception me)
{
MessageBox.Show(me.Message);
}
Friends, Is there any problem in my code?
Any idea’s or Link
Help me
Thank u.
by
Joe
|
|
|
|
|
The account which runs this service must have sufficient privileges on the system that is being connected to.
|
|
|
|
|
Thanks for ur reply.
yes i have given the Administrator username and password of the remote system.
any other problem??
thank u
by
joe
|
|
|
|
|
As this forum is quite old but in case you need any help, let me know. We completed medium size internet projects where i troubleshoot all this.....
|
|
|
|
|
Hai
Thanks for u r reply.
plz give solution for this problem.
I've given administrator username and password.
it works fine for remote system when i execute as windows exe
but when i create as windows service it throws "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" error.
Thank u
by
joe
|
|
|
|
|
Hello friends,
Here is the coding of convertion of month to string its Showing
Month and Date ie "August 30"
I want only Month how can we get it.
Below coding is showing like that.
strmonth = dtNowMinusOne.ToString("M");
please give me a solution its urgent
thanks in advance
Kankeyan J
|
|
|
|
|
|
Is there any way to declare global variable in c# that can accessed by all class of application ??
|
|
|
|
|
Bhavesh Bagadiya wrote: declare global variable in c# that can accessed by all class of application
Anti-OOPs.
Use a static class that should be befitting your bill/requirement.
|
|
|
|
|
public static variables will do the trick;
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
There are no global variables in C#. You have to put the variables in a class.
You can make a static class with public static variables in it. Those are accessible from anywhere in your application. Also, it's obvious that the class is intended for this, as you can't create instances of a static class.
---
single minded; short sighted; long gone;
|
|
|
|
|
how can you make a static class?
and what is partial class?
|
|
|
|
|
XFighter wrote: how can you make a static class?
Create a class and make it static...
Example:
public static class Settings {
public static string AppName = "My Super Application";
public static string AppVersion = "0.9 beta";
}
XFighter wrote: what is partial class?
A partial class is a class that is partially defined in two different places, usually in two different files. This is regularly used when part of a class is auto generated, like a web page class.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi, is it possible to simulate mouse clicks in a windows form, though the form is hidden/invisible?
I want to write a kind of click bot for internet sites and because i can't directly access some elements from the site i want to simulate mouse clicks, but the form has to be hidden, so it doesn't disturb the user. is that possible?
greetz Knack
|
|
|
|
|
|
Add this line to the top of your codefile:
using System.Runtime.InteropServices;
Then add these lines of code after the open brace in Form1 (or whatever your form is called):
private const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002;
private const UInt32 MOUSEEVENTF_LEFTUP = 0x0004;
<br />
[DllImport("user32.dll")]<br />
private static extern void mouse_event(<br />
UInt32 dwFlags,<br />
UInt32 dx,<br />
UInt32 dy,<br />
UInt32 dwData,<br />
IntPtr dwExtraInfo<br />
);
To simulate a left click, you would then use this code:
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, new System.IntPtr());
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, new System.IntPtr());
And that's it!
- Virtual1ty
|
|
|
|
|
Dear all,
here i have done a grid node like user control for displaying the items in each and every page
in that grid i have a dropdown list for selecting the feature of the item . here i has to fetch the fetch the feature from database and based upon that i has to display.
the below i had written but it is not working
so please help me
Thanks and Regards
protected void gridnode1_SelectedIndexChanged(object sender, EventArgs e)
{
dsfeature = con.GiveDataSet("select features from b2bpattributes ,b2bproducts where b2bpattributes.productgroup in (select productgroup from b2bproducts where productid='" + str2 + "') and b2bpattributes.productid=b2bproducts.productid and b2bproducts.available='Online'");
//select features from b2bpattributes where productgroup in (select productgroup from b2bproducts where productid='" + str2 + "' and available='Online')");
if (dsfeature.Tables[0].Rows[0]["features"].ToString() != "")
{
if (dsfeature.Tables[0].Rows.Count != 1)
{
//lblfeature.Visible = false;
ddlfeature1.DataSource = dsfeature;
ddlfeature1.DataTextField = "features";
ddlfeature1.DataBind();
}
else
{
//lblfeature.Visible = true;
lblfeature.Text = dsfeature.Tables[0].Rows[0]["features"].ToString();
ddlfeature1.Visible = false;
//lblselect.Visible = false;
}
}
else
{
ddlfeature1.Visible = false;
//lblselect.Visible = false;
}
}
sai krishna
|
|
|
|