|
For getting Pictures from Webpages i use following Code:
---------------------------------------------------------------
WebRequest request = WebRequest.Create("<urltofetch>");
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
Stream local = File.Create("filename.gif");
byte[] buffer = new byte[1024];
int n;
do
{
n = stream.Read(buffer, 0, buffer.Length);
local.Write(buffer, 0, n);
} while (n > 0);
stream.Close();
local.Close();
---------------------------------------------------------------
Where the url can be whatever you want ...
Hope this will help!
|
|
|
|
|
How can I get rid of the beep that happens when I press enter on a form with no default button?
|
|
|
|
|
Add a default button? It seems to me that every form should have a default button, no?
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
Unless the application is a simple, one form, dialog application.
Have you tried catching the key down event?
|
|
|
|
|
I tried, but it didn't seem to work.
But I fixed it with a default button that's positioned outside the form
|
|
|
|
|
Ouch. That seems like a bit of a hack. What did you try in terms of capturing the Enter key?
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
Sorry, can you tell me where can I download Rotor? I cannot find it
Thanks!
|
|
|
|
|
http://www.sscli.net/
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
What's 'ROTOR'??? I've been hearing alot about that lately...
and instead of actually going to the link provided by the message below this, and finding the answer in 10 seconds. I'd much rather wait a day and, have my question answered here.
/\ |_ E X E GG
|
|
|
|
|
partial sample .net implementation from microsoft with source code (to say it shortly)
|
|
|
|
|
Rotor is the codename (friendly name?) for SSCLI, the Shared Source Common Language Infrastructure. Essentially it's the source for a shared source C# compiler and CLR. If you download it you can see the source for a garbage collector, a C# compiler, how to run managed code in a "sandbox" etc, etc. Of course, there are millions of lines of C** and C# code in there, so it can be a little obtuse <g>.
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
So, what... Is it like a ghetto .NET???
/\ |_ E X E GG
|
|
|
|
|
No, it's for the official standardization of the C# language and the CLR for the ECMA. A "reference" version, if you like.
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
I am trying to create a Windows Form using C# that can load a dll from the client machine. The dll, uses a COM server to communicate with the COM ports.
The code looks like this so far:
public const string CPH_DLL = "cimphone.dll"; // Import library for Kernel on Win32
[DllImport(CPH_DLL)] public static extern int PingPhone(StringBuilder port);
[DllImport(KER_DLL)] public static extern uint LoadLibrary( string lpFileName );
uint m_hModuleOGL = LoadLibrary(CPH_DLL);
PingPhone("COM2");
The problem is that it is loading the dll on the server and accessing the port on the server. I need it to run on the client running the form.
Any suggestions or tutorials on this subject?
|
|
|
|
|
is there a way to use c# to communicate with the parallel port efficiently. i.e without COM and winows dll imports.
|
|
|
|
|
|
I also needed direct access to the parallel port from C# few months ago I can send you a working sample if you're interested, just let me know.
It is of course not a clean C# solution, I have built a C++ dll which exposes 4 methods that read/write data from/to the specified I/O port, and created a C# wrapper class for these methods.
Also, you need a special driver for windows 2000/XP, because normally executable files don't have direct access to the I/O ports under these OSes. It is called UserPort, I don't remember where did I download it but I can send it to you if you need it too.
Rado
|
|
|
|
|
I'm in the middle of a C# Parallel Port program. I'm using a tweeked out version of the NTPort library...
Can you hook me up with your C++ dll??? I'd like to check it out.
/\ |_ E X E GG
|
|
|
|
|
I've sent a zip archive directly to your e-mail, let me know if you need anything else.
Rado
|
|
|
|
|
why not use a dll whats the difference. If you want to code at the hardware level do c++
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I have a program that does it. It's called "Ghetto Parallel"...
It's not ghetto though. Would you like to check it out??? However, it does use the NTPort Library... and I think you said you didn't want anything like that...
well, if you wanna check it out anyways... email me.
/\ |_ E X E GG
|
|
|
|
|
I have somthing of a problem with databinding objects from a wsdl.exe generated SOAP proxy.
The generated proxy objects expose their data as public fields, rather than properties. DataTextMember will only bind to a property. The only ways round this that I can think of at the moment are:
Wrapper classes for object in the SOAP proxy.
Nope, don't like that idea one bit, Dumb hack.
Use reflection in a generic wrapper class that converts the contained objects fields into properties
Seems overkill, see below.
Wait for an answer here, as I suspect I am missing something obvious to someone else
Ryan.
|
|
|
|
|
Whats the big deal about extending the class and binding to the properties created there. All you have to do is casting it up
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
The classes are generated by wsdl.exe and are likely to change, there are quite a few of them too.
It seems like an ugly soloution to bash out 20 odd derived classes just to convert their public fields into properties. I guess I'll fiddle with IReflect
Ryan.
|
|
|
|
|
Well here you go an article on this site using CodeDom to modify them to properties without typing all the code for each class
Article about it
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|