|
Thank you for the information, Eddy. Will test them out.
|
|
|
|
|
I have seen many applications that make use of the ActiveSync connection to a mobile computer to perform functions. A couple of well known examples are remote registry editors and remote display tools. I'd like to understand the architecture better to know how to invoke a method on the desktop side that acts on the mobile computer side. For example, I'd like to write an application that detects when a device is up on ActiveSync, and then displays information about the mobile computer such as serial number, MAC address, manufacturer, model, etc. Many of these are P/Invoke calls, and I can write WinForm applications that get some of these variables that run on the device locally. I would like to better understand how to use ActiveSync to invoke such calls on a desktop WPF application, get the information from the device, and display it in a table within the WPF application. Would I make use of a socket of some kind? I don't know where to start with this.
Regards,
Scott
|
|
|
|
|
Hi
I am trying to build a calculator and use a WCF web service to do the math part. I need to pass the two integer arguments to my web service.
I defined the numbers on calculator as buttons.
Now I need to pass input to web service based on the two values clicked on calculator.
Can you please tell me how do I get the values into the button1 click event based on button4 and bitton 2. ( For now I just have two numbers on calculator..)
public partial class Calculator : System.Web.UI.Page
{
private int i, j;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
MathClient client = new MathClient();
try
{
int ii = client.Add(5, 6);
Result.Text = Convert.ToString(ii);
}
catch (Exception ex)
{
Result.Text = ex.Message;
}
}
protected void Button3_Click(object sender, EventArgs e)
{
int i, j;
i = 4;
j = 4;
}
protected void Button2_Click(object sender, EventArgs e)
{
int i, j = 4;
}
}
|
|
|
|
|
When you declare the integer variables i and j inside the Button Click event of Buttons 3 and 2: you create are creating variables local to those event handlers: so your class-scoped integer variables with the same names are never getting set.
The Button1 Click event will, therefore, also see i and j as having their default value: 0.
So set i and j in the Buttons 3 and 2 event handlers, but do not declare them there.
best, Bill
"Use the word 'cybernetics,' Norbert, because nobody knows what it means. This will always put you at an advantage in arguments." Claude Shannon (Information Theory scientist): letter to Norbert Weiner of M.I.T., circa 1940
|
|
|
|
|
Greetings Gurus,
I have been hunting around for a while now and would like to know if there is a way to get system information such as pc manufacturer, pc model, pc serial number, total/available memory (RAM) slots etc. etc.
using C# but without using WMI (which I find to be a bit lumpy and resource intensive)?
Eagerly awaiting your response/s...
Thank you.
|
|
|
|
|
You can find a lot without WMI, but then most of it will require access to Win32 functions, hence P/Invoke.
There is more information available inside WMI (e.g. the details of the memory slots).
A lot of information is optional, manufacturers can provide it, but they don't have to. Most of that, when available, requires WMI.
And finally getting some information requires administrative rights (and will cause UAC dialogs on Vista and above).
|
|
|
|
|
Hi Luc,
I have extracted about as much relevant information as I can from System.Environment, SystemInformation, System.Net.NetworkInformation & registry.localmachine as possible but I was hoping to pull some of the WMI-type information without using WMI.
I was wondering if there was a "System" namespace available that could fill in the blanks.
|
|
|
|
|
No, there isn't, other than WMI. You're going to have to write a TON of code to get even a tenth of the information you can get from WMI, and the code you write is not going to work on all systems and on all hardware revisions. Still want to avoid WMI??
|
|
|
|
|
Hi Dave,
If I can
I read a forum post about using System.VisualBasic.Devices's ComputerInfo but can't get it to work.
Have you come across that namespace?
|
|
|
|
|
What's so hard about it?
using Microsoft.VisualBasic.Devices;
...
Computer c = new Computer();
Debug.WriteLine("O/S: " + c.Name);
EDIT: My bad, I forgot which forum I was in...
|
|
|
|
|
I developed a small remote application, and connected with one of my client. But everytime Iam using the below code to connect with my server and accessing the sqlserver...And hence I found my application is slow at data loading and saving...
Is there any other way to connect the server faster manner ? or Any other approaches...
Thanks for the helps
public string WMSCon_1 = "Data Source=172.178.1.120; initial Catalog=Sales_Master; User Id=codeproject; Password=xxxxxxx"
Actually I given the above connection string and connecting with the client for data access. Simply every where Iam giving the ip and just connecting, whether I have to keep any other things for this remote access to increase the speed..?
Thanks
PARAMU
|
|
|
|
|
Paramu1973 wrote: remote application
What do you mean by "remote"?
Paramu1973 wrote: my application is slow at data loading and saving
You would probably have to show a sample of how you're doing it; it may be very inefficient code. It's unlikely to be due to the connection string.
Perhaps you'll want a Web Service.
|
|
|
|
|
Hi,
Thanks for the helps.
There is nothing to say inefficient. Since I just connect via IP as mentioned in my prior post. Yes. As per the advice, I will try to write the web service and may be the best solution.
|
|
|
|
|
Hi everyone, with the below code, I'm able to draw a rectangle by clicking and dragging the mouse. So the question is: Can I access the controls within that selected rectangle/area? Any clue or a piece of code that puts me in the right direction would be appreciated. Thanks
Rectangle re;
private void form_MouseDown(object sender, MouseEventArgs e)
{
re.X = e.X;
re.Y = e.Y;
re.Width = 0;
re.Height = 0;
}
private void form_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
re.Width = e.X - re.X;
re.Height = e.Y - re.Y;
this.Invalidate();
}
}
private void form_Paint(object sender, PaintEventArgs e)
{
SolidBrush myBrush;
myBrush = new SolidBrush(Color.PaleTurquoise);
e.Graphics.FillRectangle(myBrush, re);
}
private void Form1_Click(object sender, EventArgs e)
{
re = new Rectangle(0, 0, 0, 0);
this.Invalidate();
}
|
|
|
|
|
Without trying it, off the top of my head, one way to achieve this would be to use the Rectangle.IntersectsWith method. Basically, each control on your form has a corresponding rectangle associated with it, and you would be able to compare this with the rectangle you've dragged out.
Note that this assumes you want to pick any control touched by your rectangle. If the child controls must be inside the rectangle, you could use Rectangle.Contains . As an optimisation, I'd be tempted to do one pass and add the control id and rectangle into a Dictionary so that you don't have to look it up every time.
|
|
|
|
|
thanks so much! I was making deep math to solve it. I would'nt think it was so simple )
|
|
|
|
|
You're welcome. Glad I could help.
|
|
|
|
|
I need to call control panel functions using c# or vb.net.
As a example how can i call internet properties using c# or vb .NET. If anybody know please tell me how can i code.
Thanks
|
|
|
|
|
The Control Panel items are executables inside a system folder, and with a special extension of .cpl
You can discover which is which by launching one, then using a tool (e.g. Task Manager) to figure which file is running (it will be a rundll, so you'd have to watch for the actual command line).
And you can launch them using a simple Process.Start
On most systems Internet Settings are handled by C:\Windows\system32\inetcpl.cpl
|
|
|
|
|
I want to write an application that will interface with the Authentec AES2810 embedded fingerprint swipe sensor on my laptop. No SDK came with it, and it is being used presently to logon to Windows.
I installed Windows Driver Kit thinking I could use that to access the swipe sensor, but don't know how to. I have tried Griaule SDK but it doesn't recognize the sensor.
Pls. I need help. I just need the required dlls and skeleton code to capture fingerprint data from the sensor. I prefer C#.
Also I want to find out if there is no scanner dialog / fingerprint dialog that one can use in Visual Studio (eg using WIA) to capture image from a scanner/sensor, like the print dialog in VS.
Thanks.
|
|
|
|
|
Why didn't you start here[^]? They made the scanner so, obviously, they would have some method of using it in your code, such as providing an SDK for it.
|
|
|
|
|
Hi,
Is there any FREE library which will allow me to open a pdf and show it on a winform project without using AcroPDF.dll
|
|
|
|
|
ITextSharp[^].
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
ITextSharp is for create/edit purpose of PDF....? If OP just wants to open the file, then can't he do so by calling Process.Run('FilePath'); method....?
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
Sure, if they have a PDF reader installed and the file association is registered with Windows, they could do that. I was under the impression that the OP wanted to show the PDF in his application.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|