|
images have to be stored in memory or in a file. Valid file paths don't start with http://
I use MemoryStream in such situations, see downloadImage() in CP Vanity[^].
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
If you don't want to use a temp file, then:
1) create a web request
2) use the web request to get a web response
3) use GetResponseStream() to get stream of image
4) create image from stream
5) assign image to picturebox1.Image
Jack of all trades ~ Master of none.
|
|
|
|
|
You do not need to bother yourself with things like web requests to do this as others have suggested - this is completely unnecessary. As stated above just set ImageLocation to the URL you need.
Regards,
Rob Philpott.
|
|
|
|
|
My service constantly receives several different messages...
I would like to place a logic which checks if a prticular message is received within (A particular time interval) say 30 seconds of the previous one.
What is the best way to start this? where should I keep the previously received messagetime so that I can compare it to the new received time?...
Thanks
|
|
|
|
|
Use the use private (may be static) DateTime variable to store timestamp of previous message.
use the Timer or Lock statement to check if it changes in 30 secs.
|
|
|
|
|
Create a class which represents the message called MyMessage. Store the previous message as a static variable of type MyMessage called previousMessage. If the current myCurrentMessage.RecievedDateTime < previousMessage.RecievedDateTime.AddSeconds(30), then assumeIsSameAsPrevious. Do stuff and then previousMessage = myCurrentMessage.
"You get that on the big jobs."
|
|
|
|
|
Is this a web service or a windows service?
|
|
|
|
|
Not sure yet, but by looking at the previous replies, I have my answer to how to solve this now.
Thank you.
|
|
|
|
|
arkiboys wrote: Not sure yet
How can you not be sure of whether it's a web service or a windows service? You stated that "my service" is doing this and that. If it's "your" service, you should be completely familiar with what it is.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Apologies, I meant that I am not sure whether to have the finished result in win or web service.
Thanks
|
|
|
|
|
You can't actually store anything inside a web service. It's a transient thing. I'm absolutely astonished that you have started coding before you've even considered the overall architecture. Has nothing that we have said sunk in at all?
Before you write any more code, sort out your architecture. You are digging yourself into a bigger and bigger hole, and hoping that we have enough rope to pull you out.
|
|
|
|
|
Yep. Understanding the ramifications of each plaform, langauge, and architecture choice is crucial to designing an app.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Hello,
Thank you for your concern...
At present I am actually testing the flexibility as I am learning and reading alot...
I do believe i now know the capabilities of windows service and I think you are right, I will intent to use the windows service when I am comfortable with it as I am testing to see how i get on with it.
many thanks
|
|
|
|
|
Wow! Both very different things. Unless you are sure about your service, it is very difficult to decide on the correct solution.
|
|
|
|
|
The solution is to create a HashTable with the DateTime as the key (stripped of the seconds/milliseconds), and the message as the value . Each time you try to add it, the nature of the HashTable will prevent duplicate keys from being added. Problem solved.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Hi,
I made a tool to read a .mdb File, everything works fine except on a 64Bit Machine...
To connect to the database I use OLEDB 4.0, but it seems that 64x does not provide this.
How could I compile this compatible??
OleDbConnection con = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" + lblDATABASE.Text);
con.Open();
|
|
|
|
|
You need to add the App.config file I believe.
V.
|
|
|
|
|
sry I don't know what you mean. 
|
|
|
|
|
I had a similar problem and strangly, by adding an App.Config file to my project (even if it is just empty) the connection then works.
Right click your project, choose add item --> new and find the template 'config', normally it should automatically name it App.config. Press OK. recompile and try again.
V.
|
|
|
|
|
Compile it to x86.
I cannot remember: What did I before google?
|
|
|
|
|
Yeah I already tried this, but doesn't work..
I tried "any cpu" / "x86" / "x64" to build.
|
|
|
|
|
You have to set it in the "project properties", in the "build" tab, "platform target". I had the same problem with an old application using access, and it worked fine for me.
I cannot remember: What did I before google?
|
|
|
|
|
Yeah I know!
I already tried this, without success! 
|
|
|
|
|
Thanks for your replies, it seems that the .exe need the manifest.
Now it works =)
/closed
|
|
|
|
|
ok, if this worsk for you it also fine.
I cannot remember: What did I before google?
|
|
|
|