|
Developing a web server in C# probably wouldn't be the most efficient language to use, however if this is something you want to attempt, you should take a look at the System.Net[^] namespace, specifically the Socket[^] class.
- Nick Parker My Blog | My Articles
|
|
|
|
|
If you want to host an ASP.NET web application without IIS, you can use the hosting interfaces. See the System.Web.Hosting[^] namespace in the .NET Framework SDK. Read ASP. NET Client-side Hosting with Cassini[^] in MSDN Magazine for an example of using the ApplicationHost class.
There's also several articles about building a web server (HTTP daemon) here on CodeProject, like Create your own Web Server using C#[^] by Imtiaz Alam. You can search for additional articles using the site search feature.
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]
|
|
|
|
|
This will probably remain unanswered, but does anyone know of a method of finding out whether a pocket PC (ipaq) is attached to the desktop via the usb port? I've looked briefly at WMI using:
select * from Win32_USBHub
and System.Management.ObjectQuery, but couldn't find any clues. My other guess is that I use SendMessage with the ActiveSync exe, but this will be fidley.
Thanks
|
|
|
|
|
smallguy78 wrote:
This will probably remain unanswered
That's a rather negative way to start off a question. Fortunately some of us like research.
There are several ways documented in the ActiveSync APIs, from getting notified of connection to querying for a device ID, which I've coded below:
using System;
using System.Runtime.InteropServices;
class DetectDevice
{
static void Main()
{
int id = CeGetDeviceId();
if (id == 0)
Console.WriteLine("Device not connected.");
else if (id == -1)
Console.WriteLine("Quest device connected.");
else
Console.WriteLine("Device ID: " + id);
}
[DllImport("ceutil.dll")]
static extern int CeGetDeviceId();
} Unfortunately I'm not able to test this, but it should work. This morning I decided to leave my iPAQ at home thinking I wouldn't need it, but figuring that if I didn't take it I'd probably need it. I guess I did.
Let me know if this works, though. There are a number of other ways, but this way seems to be the easiest.
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]
|
|
|
|
|
Heath Stewart wrote:
Fortunately some of us like research
You can say that again.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi all,
Iam developing an pocket pc application in .NET Compact framework and run it the emulator. I dont know where the EXE and other application files are stored in that emulator.
Sridhar.
|
|
|
|
|
Hi all,
Iam developing an pocket pc application in .NET Compact framework and run it the emulator. I dont know where the EXE and other application files are stored in that emulator.
Sridhar.
|
|
|
|
|
The application is loaded into memory, along with dependent assemblies from dependent projects. To actually install the application and related content files you need to create a deployment project, then deploy into the emulator.
For more information about developing Smart Device Application and deployment projects for said projects, read Developing Smart Device Applications[^] in the MSDN Library.
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]
|
|
|
|
|
hi,
Thanks for your kind reply, I have some more doubts in this regards could u suggest me any tutorial and other books in internet. It is possible to trace TAB Key in Compact Framework and also can i create my own components like numeric textbox, alpha textbox etc.....
Thanks and regards,
Sridhar.
Sridhar.
|
|
|
|
|
hi,
Thanks for your kind reply and say it is possible to manually copy a file from PC to Emulator.
Thanks
Sridhar.
sdaf
|
|
|
|
|
Follow the link I gave you. Under that is a topic that clearly describes how to do what you want.
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]
|
|
|
|
|
hi,
Thanks for your kind reply, I have some more doubts in this regards could u suggest me any tutorial and other books in internet. It is possible to trace TAB Key in Compact Framework and also can i create my own components like numeric textbox, alpha textbox etc.....
Thanks and regards,
Sridhar.
Sridhar.
sdaf
|
|
|
|
|
If by "trace" you mean capture, then yes you can capture the [Tab] key being pressed. Handle the KeyDown event (or, in a derived control, override OnKeyDown , being sure to call at some point base.OnKeyDown ) and check the KeyEventArgs.KeyCode for Keys.Tab .
You can extend controls to create your own, or create a UserControl derivative to contain multiple controls (what's called a container control). There's really not much you can't do.
If you're new to programming, I suggest browsing the relevent articles here on this site and checking out books about .NET at http://www.microsoft.com/mspress[^].
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]
|
|
|
|
|
hi,
once again Than Q, Happy New Year, Please could you give the sample code to capture the Keys and for User controls.
Please mail to k.sridhar@solutionnet.net
Thanking you,
Sridhar.
Sridhar
|
|
|
|
|
hello
i am calcualting factorial and saving its value in double data type. But double can't calculate factorial of >170 .
Plz help me if u know how can i calculate factorial of above 200 or say 500 factorial.
Regards
asmyan
|
|
|
|
|
The following appears to work for me:
private double factorial(double f)
{
double num = Math.Floor(f);
if(num < 0)
{
return -1;
}
if(num == 0)
{
return 1;
}
else
{
return (num * factorial(num - 1));
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
hello
Thank you so much for such a quick prompt. All of you are so nice and helping people.
Regards
asmyan
|
|
|
|
|
hi
you must use arraylist;
do this:
you must define the multiplication yourself on the arraylist.
each elements of arraylist contains only one integer.
say
for( int i=1;i< 500;i++)
{
multiplay i in each elemnt of arrayList and add its more than 10 of element to next element such you do on paper.
}
you can calculate n! by this
|
|
|
|
|
hello
i am calcualting factorial and saving its value in double data type. But double can't calculate factorial of >170 .
Plz help me if u know how can i calculate factorial of above 200 or say 500 factorial.
Regards
aneela
|
|
|
|
|
|
leppie wrote:
Why on earth do you wanna calculate such huge numbers?
That's usual demonstration of difference between recursive vs. iterative algorithm in terms of speed.
(Iterative one is much faster in this case)
Hmm and practical use of 500! ? benchmarks maybe...
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
You might want to check-out the C# BigInteger Class[^] article here on CodeProject. That may help.
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]
|
|
|
|
|
hello
Thank you so much for such a quick prompt. All of you are so nice and helping people.
Regards
asmyan
|
|
|
|
|
I was chagrinned that .NET doesn't have a BigInteger class, but this one by Chew Keong Tan looks good. I gave it a quick try with this:
public static BigInteger factorial( int n )
{
BigInteger result = new BigInteger(1);
for( int i = 1; i <= n; i++ )
result = result * i;
return result;
}
... And later, in Main():
Console.WriteLine("factorial of 170 = " + factorial(170) );
And it works just fine, giving:
7, 257, 415, 615, 307, 998, 967, 396, 728, 211, 129, 263, 114, 716, 991, 681, 296, 451, 376, 543, 577, 798, 900, 561, 843, 401, 706, 157, 852, 350, 749, 242, 617, 459, 511, 490, 991, 237, 838, 520, 776, 666, 022, 565, 442, 753, 025, 328, 900, 773, 207, 510, 902, 400, 430, 280, 058, 295, 603, 966, 612, 599, 658, 257, 104, 398, 558, 294, 257, 568, 966, 313, 439, 612, 262, 571, 094, 946, 806, 711, 205, 568, 880, 457, 193, 340, 212, 661, 452, 800, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000
At least it got the same number I calculated off the top of my head.
(I formatted with commas and spaces to prevent extreme horizontal scrolling in this post! (and no, I didn't insert them manually -- do you think I'm nuts?))
Matt Gerrans
|
|
|
|
|
Matt Gerrans wrote:
do you think I'm nuts?
You must be if you calculated that in your head!
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]
|
|
|
|
|