|
I have been trying to monitor the handshake (signal) from
a printer for each page it printed but i have not been
able to do so. Can any out there help me.
|
|
|
|
|
That might be a little too low level for C# to handle easily. In the Windows DDK there are a set of parallel port functions you can try to hook into (like IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO ) but I don't think any of them have been exposed in C#. And that assumes that you are using a parallel port printer.
If you are doing lower level OS I/O, C# tends to be a poor choice to use. The abstraction layer PrintDocument is there to avoid the messy OS level details of talking to the hardware. Why are you interested in the hardware communication?
|
|
|
|
|
Am interested because am writting a printer monitoring program that will monitor the printerout from any printer.where am having problem is getting the actual number of pages printed and also to be able to know when a page is printed in a situation where there is more than one page of the document.
|
|
|
|
|
I have written my first .NET app (yes, I'm a .NET newbie) very simple app just testing out some of the form functionality. Everything works well on my machine but when I copy it to our network and execute it from there I get
a System.Security.SecurityException thrown (Additional Information: "Request Failed") when creating the main form, Form1.
I know this is probably something simple but would really appreciate the help. I haven't done anything related to security yet (at least not that I know of!) so I would have thought that security wasn't an issue
Help! I'm going nuts
thanks in advance
CJE
|
|
|
|
|
1) Open Control Panel -> Administrative Tools -> Microsoft .NET Framework Configuration.
2) Expand Runtime Security Policy -> Machine -> Code Groups -> All Code.
3) Select Properties from the right-click menu of LocalIntranet_Zone.
4) On the Permission Set tab change the Permission Set to FullTrust.
|
|
|
|
|
YES!! you are a life saver...thanks
|
|
|
|
|
This is not necessarily the best idea. You're saying that you fully trust ANY code running from the Intranet zone. If you're so sure, you could do this, but a better way is to right-click on either All_Code under the machine policy, or the Intranet_Zone and add a new Url membership using the server name and directory like so: file://SERVERNAME/Directory/* (you can use more directories if you like). If you did this with the Internet_Zone code group, you're opening your machine up for any kind of .NET attack possible. The Intranet_Zone could contain code just as harmful, either intentionally or unintentionally.
You'd be better off managing separate code groups for your applications and leaving the default permissions.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Quick Question: How can I rotate an image using GDI?
Extended Question: I am playing around with an application that is a very quick and dirty fax viewer, the user loads an image into a picture box and from there can apply various transforms on it to make the fax more legible.
When the user selects a transform, I retrieve the image object attached to the picture box and get the graphics object from that image, from there is all gets a bit fluffy, I have tried using
g.RotateTransform(90)
g.Transform.Rotate(90)
And also creating a matrix and transforming using that (as described in the MSDN), but none of these methods seem to work. After some trawling through CP I havent found anything that using rotational transformations (although the articles by Christian Graus in the C# GDI section are brilliant, the only thing he doesnt do is rotation)
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
|
Thanks for the reply, obviously missed that one
Just incase anybody is searching the forums for the same answer as I was. The project above does exactly what it says on the tin, but it over complicates something that turns out to be quite simple.
I found that an bitmap object has a RotateFlip method, that allows you to specify certain flip and rotation methods.
e.g.
myBmp.RotateFlip(RotateFlipType.RotateNoneFlipY);
myBmp.RotateFlip(RotateFlipType.RotateNoneFlipX);
....(and many more)
These work as they should, but you need to bear in mind that the rotation is carried out in memory so you need to write back the amended data into the bitmap object.
e.g.
System.IO.Stream imgStream = new System.IO.MemoryStream();
myBmp.Save(imgStream, destFormat);
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
Does anyone know how to add a linefeed to a XML comment. I can add them manually inside the comment, but NDOC wants to bunch the text together.
Example
becomes
This is a test
in the documentation file.
How do I get it to do this
This
is
a
test
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Use <br /> . And to be fair (since I'm on the NDoc team), any XML parser canonicalizes text based on the canonicalization method used by the parser. All parsers of which I'm aware treat line breaks as spaces between matching tags and ignore them (depending on the whitespace settings) between adjacent tags. It's not NDoc that's ignoring them, it's the XML parser we use (which is, of course, the parser in the System.Xml.dll assembly).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks that did the trick
Heath Stewart wrote:
And to be fair (since I'm on the NDoc team), ...
I wasn't complaining, I was just pointing out that it behaved differently than I expected.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Actually I want in my application that when a user presses right click on the button than a popup menu will open with different options. How can i develop this popup menu.
If there are any articles regarding this also write them in the answer
Thanx in advance
Regards
MInamKhan
Inam
|
|
|
|
|
From toolbox add a ContextMenu to your form and add options to it. Then set the ContextMenu property of button to the name of this ContextMenu .
Mazy
No sig. available now.
|
|
|
|
|
Hi,
I want to automate a frequently download on a web site that provides data. This one uses cookies to recognize its members an autorize them to download.
The problem is that using the WebRequest class to access this file, the Server I want to connect to doesn't search cookies on my computer, and so doesn't recognize me as a member.
How can I do ?
Thank you very very much ...
|
|
|
|
|
See the HttpWebRequest.CookieContainer property documentation in the .NET Framework SDK. Provide a CookieContainer to store cookies.
Also, a server does not search your cookie collection. That would be extremely dangerous (although there are security holes in implementations some times that allow servers to request a different cookie)! The browser sends cookies for the server and path relative to the request.
You'll have to devise a way to get the cookie and put it in the CookieContainer , though. The HttpWebRequest.Credentials property may help as well since you require authentication, those forms authentication makes implementations like this difficult.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok, I think I understand. I'll try to manage to build a right CookieContainer.
Thanks.;)
|
|
|
|
|
Hi everyone,
I'm trying to set the initial directory of the OpenFileDialog to the "My Documents" directory - is there a simple way to achieve this? Is there a system variable like %SYSTEMROOT% which allows you to set the initial directory to the windows install directory?
<br />
OpenFileDialog ofd = new OpenFileDialog();<br />
ofd.InitialDirectory = "%SYSTEMROOT%";<br />
I tried to google this and perhaps I'm using wrong keywords, but I didn't find anything
Thanks in advance,
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
Environment.SystemDirectory
Mazy
No sig. available now.
|
|
|
|
|
I was looking for the path to the "My Documents" folder but thanks for pointing the Environment class out! I didn't even know that it exists, and Environment.GetFolderPath(Environment.SpecialFolder.Personal); does the job.
Thanks again!
rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
i was meaking combinations of a,b,c.
how can i make all possible combinations.
this should show result like this.
aaa
aab
aba
bba
baa
acc
aca
cac
caa
cca
ccc
bbc
bcb
cbc
ccb
cbc
abc
i was thinking that i will be using
nested for loop with array
that will pick one by one charactors
and place it on the loop and make
all possible combinations.
Mazhar Hussain
|
|
|
|
|
Maybe I don't understand what you're saying. You want a program that prints out all of the possible combinations of "a", "b", and "c", right? It seems as though you already know the answer. It appears that you already know the answer but just to make sure, you're talking about doing something like the following, right?
<br />
string[] letters { "a", "b", "c" };<br />
<br />
foreach (string s1 in letters) {<br />
foreach (string s2 in letters) {<br />
foreach (string s3 in letters) {<br />
Console.Writeln(s1 + s2 + s3);<br />
}<br />
}<br />
}<br />
Stated without guarantee - express or implied - by an employee of Harbinger Software
|
|
|
|
|
|
:-DHello,
currently I am working on a mailapplication that checks my mail on different mailservers. Sometimes i want to view the contents of the message.
I am now currently using a Windows Form with a richtextbox. That richttextbox.Text is filled with a string which contains my message. Most messages are in HTML-format. So i get the HTML tags in the text. How do i prevent that? How can I convert that string to HTML and which component should I use to show the mail in stead of the richtextbox.
Regards,
Herman Talstra
homo sapiens non urinat in ventum
|
|
|
|