|
If the path is specified by the user then use
Image img = Image.FromFile ( @foto );
|
|
|
|
|
as i understood that u ve image and u want to open it from stream file...
1-u cant use Image class as it is abstract one, so u cant define object from it
2-u use Bitmap class to open ur image
//example: dont forget to use (Using System.Drawing)
Bitmap myimage=new Bitmap(filestream,true);
//constructor use true to make error correction..hope it works
|
|
|
|
|
Hello,
I'm developing some windows based application. I have made a setup to deploy the application to some other computer. I want to deploy an application for only 15 days. Or you can say that i want to deploy an application as trail version of 15 days for testing purpose. After 15 days, application should be stoped working automatically. Hopefully, someone will understand my question and will reply me as soon as possible.
Thanks.
|
|
|
|
|
IF your are asking a question like this, i doubt anyone would buy the app. :\
|
|
|
|
|
Infact, i have to deploy the application for testing purpose to the company before the final deployment. So instead of giving me this answer, reply me the solution.
Thanks.
|
|
|
|
|
There are multiple ways and there are also a multitude of companies that make a living off of providing this type of solution. I don't think there is an easy solution that can be posted to the forum.
The easiest way would probably be using a registry key added upon instalation and some code in the app that checks the key and compares a date against a certain period of time.
Here are some long list of companies providing ready made components. I only see one open source one but there may be more.
http://dmoz.org/Computers/Software/Licensing/License_Management/
http://dmoz.org/Computers/Security/Products_and_Tools/Software_Protection_and_License_Control/
--------------------
It is what is is!
|
|
|
|
|
there are C++ examples, such as Nish's one[^] that do what you are asking, maybe you can port those over to C#.
To those who didn't make it, we will remember you. To those who did is back. - Megan Forbes in Black FridayAnother Post by NnamdiOnyeyiri
|
|
|
|
|
Hi
Is there any method by which I can make an app transparent...like even if it appears(not completely transparent), it should not respond to mouse clicks (say if the ctrl key wasnt pressed along with a mouse click) and should transfer the ctrl to the app behind it...
Example:
Letz a scoreboard display and behind it IE...u dont need any user triggered event for it...so even if i click in the display, IE should respond and not the display..
Is there any method in C#?
Thanks
|
|
|
|
|
Oh most definately, there is a property in the System.Windows.Forms.Form class! Make a form with these properties:
/////
this.TransparencyKey = System.Drawing.SystemColors.Control;
this.Opacity = .8;
/////
Setting the TRANSPARENCYKEY to that will make the form seem invisible. Not visibly, but... like you said, it makes it so when the user clicks, it responds to whatever is running behind it.
Setting the OPACITY makes it look invisible. Setting it to "1.0" makes it very slightly invisible, however, when set to ".1" you can hardly see it.
Hope this helps!
|
|
|
|
|
kewl thanks..ill try it...
|
|
|
|
|
But is it possible to get the controls to this transparent window when needed (like it shud respond whenever i click the mouse along with the ctrl key)...?? Because from what you said..it seems that windows will manage the ctrls and decide only based on opacity and not on programmer's setting right?
|
|
|
|
|
Here ya are! Best I can come up with so far! Any questions?
<br />
public class Joshua : Form {<br />
[STAThread]<br />
public static void Main() {<br />
Application.Run(new Joshua());<br />
}<br />
<br />
public Joshua() {<br />
this.ClientSize = new Size(520, 310);<br />
this.Name = "Form1";<br />
this.ShowInTaskbar = false;<br />
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;<br />
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;<br />
this.TopMost = true;<br />
this.TransparencyKey = System.Drawing.SystemColors.Control;<br />
this.Opacity = .8;<br />
}<br />
<br />
protected override void OnKeyDown(KeyEventArgs kea) {<br />
if(kea.KeyCode == Keys.ControlKey) {<br />
this.TransparencyKey = System.Drawing.Color.Empty;<br />
}<br />
}<br />
<br />
protected override void OnKeyUp(KeyEventArgs kea) {<br />
if(kea.KeyCode == Keys.ControlKey) {<br />
this.TransparencyKey = System.Drawing.SystemColors.Control;<br />
}<br />
}<br />
}<br />
<br />
|
|
|
|
|
Yo buddy..
tat works...need to build my app (it is just a cricket(a game) scorecard )..as existing ones occupy my desktop
thanks again pal...tat was one awesome quickness uve got!!
|
|
|
|
|
Great! Glad I could help !
|
|
|
|
|
hi every body!
I want to write a program that can take all unread mail from OutLook, but don't know how to do it, any one have experience about it, please give me some suggest!
Thanks alot!
xyz
|
|
|
|
|
You could use a third party IMAP control. IMAP has a flag that can be checked if a message has been read. However, with IMAP, you will have to have the username and password to "login" to the account you want to check.
I have used the IMAP control from http://www.quiksoftcorp.com/.
|
|
|
|
|
hello dave,
how r u?? i hope u r okay,,,,as u r the one who advice me here very good advices...today i want to trace MSN Chat sessions...so what do u suggest??
and their history of course
|
|
|
|
|
hello there,
dave doesnt reply me so any1 knows how we know the msn chat sessions history programmatically???
|
|
|
|
|
I'm sure many of you have read several books on c# out there. I looked at the book reviews on here and didn't really find what i was looking for.
I would like a book if one exist. That takes you thru c# from beginning to advanced. Basically a book that assumes you know nothing about the language. Then when you turn the last page you know how to make real world applications with a pretty good syntax understanding. I just don't like books that say ok here is the code. and never really explains what does what. an example is great but only if you understand what the example is doing.
Is Professional C# any good?
I hate the Sam's books. They say learn in 24 hours, its more like 24 years.
I would like a book for visual c# if possible.
Thanks for your reply
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
|
|
hi,
I'm porting a program made in C to C# and I get blocked at this point
<br />
long UpdateCRC (unsigned long CRC, const char *buffer, long count)<br />
{<br />
<br />
if ( buffer && count )<br />
{<br />
do {<br />
CRC = ((CRC >> 8) & 0xFFFFFF) ^ CRCTABLE[(unsigned char)( (CRC & 0xff) ^ *buffer++ )]; <br />
} while(--count);<br />
<br />
}<br />
return CRC;<br />
}<br />
}<br />
My question is.... C# does not suppot --count and *buffer++...... how to solve it? it's better to make a dll from my old program and to call functions losing portability or there's a workaround??
thanks in advance
|
|
|
|
|
first you have to mark your method "unsafe" since it uses pointers..
unsafe long UpdateCRC (unsigned long CRC, const char *buffer, long count)
also , c# dont auto convert numbers into bools, so you have to do:
while(--count>0);
//Roger
|
|
|
|
|
and for what concern *buffer++??
I find extremly hard to use pointer in C#... =)
thanks for having answered me so fast
|
|
|
|
|
Normally you'd pass the buffer as a byte[] - you probably wouldn't even bother passing count as .NET arrays have the Length property. A non-literal translation would be:
public static uint UpdateCRC( uint CRC, byte[] buffer )
{
for ( int i = 0; i < buffer.Length; ++i )
{
CRC =
( CRC >> 8 ) & 0xFFFFFF ^
CRCTABLE[ (byte)( CRC & 0xFF ) ^ buffer[i] ];
}
return CRC;
} [EDIT] Forgot a cast [/EDIT]
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|