|
Whenever you make a request with your control do another request for favicon.ico. If that request returns a 404 then obviously there is no icon, if it returns the image, you should probably be able to use a System.Drawing.Icon object to hold it.
|
|
|
|
|
T M Gray wrote: If that request returns a 404 then obviously there is no icon,
Not really. A favicon can also be specified in a meta tag. If the OP had bothered to read my original response he would've known this.
/ravi
|
|
|
|
|
Hey guys....
So atlast what is the solution for this...
krishna
|
|
|
|
|
I'll try to explain it in simpler terms:
A site's icon is either the file favicon.ico located at the site's root, or (if the file doesn't exist), the icon file referenced in a meta tag in the page's HTML. So try to retrieve the favicon.ico file; if your attempt fails with a 404 (file not found status), read the HTML of the page in question and look for the meta tag that specifies the alternate location of the icon file.
If none of this makes any sense, you may have taken on a task that's beyond your (current) ability. I'm not trying to be snide - just honest. If you have specific questions on how to do this, feel free to ask. We'll try and help you as much as we can. But if you're looking for someone to give you a bunch of code that you can just stick into your app, you're wasting your time.
Thanks,
/ravi
|
|
|
|
|
|
I've got a class object serializing correctly using the attributes i.e. things like [XmlArray("Tables"), XmlArrayItem("Table", typeof(CompTable))]. Its saving to xml using the xmlserializer and textwriter classes.
If I want to implement something like this to improve the speed/size, can I still use the xmlserializer? or do i have to write one myself?
Optimizing Serialization in .NET - part 2[^]
|
|
|
|
|
I recommend using binary serialization. You'll have to handle versioning yourself. See this[^] serialization tutorial (in C++, but the concepts carry forward to .NET).
/ravi
|
|
|
|
|
for what reasons?
I like the readability aspect of the xml, but I saw that article about the default serialisation being quite wasteful in terms of space, and was thinking if I could apply better serialisation without much effort then I would.
|
|
|
|
|
cjb110 wrote: for what reasons?
Performance (and storage size). Of course XML is more readable and maintainable, but it comes at the expense of performance and the size of the store. If you're storing a couple of hundred objects, this won't be an issue. But if you're storing thousands, it likely will.
/ravi
|
|
|
|
|
hi.
how can read/write image from/to server?
thanks.
|
|
|
|
|
Using sockets[^] is one option.
It's time for a new signature.
|
|
|
|
|
|
You don't use an encoding. Encodings interpret the values read. You won't get the actual data from the file.
Use System.Io.File.ReadAllBytes[^].
|
|
|
|
|
|
ReadAllBytes as the name implies reads all bytes, regardless of what they should be interpreted as. Its up to you to then translate them into whatever it is you wish.
If the post was helpful, please vote, eh!
Current activities:
Playing Star Craft II. Don't bother me, eh?
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|
|
I ran a simple experiement, read all byte of HelloWorld.exe and write it to second file - it didn't run and OS complained invalid image
dev
|
|
|
|
|
Consider, if such a simple feature did not work then it would not be possible to do any form of data copying under Windows. Try showing your code, there must be an error somewhere.
It's time for a new signature.
|
|
|
|
|
How did you write the new file? Post your code snipplet.
|
|
|
|
|
Then you did something else wrong in your code. Post the read and write sections and we may be able to tell you where that is.
|
|
|
|
|
Yeah, it will work since I used it to read and parse PE format executables myself.
|
|
|
|
|
what do you mean by "raw file image"?
is it a file containing an image (i.e. header plus pixel data)?
is it a file containing the raw data of an image (i.e. pixel data only)?
is it the "image" of an executaable?
you can read( or write) all the bytes of a file at once using File.ReadAllBytes (WriteAllBytes).
If you don't want to have them all at once in memory, use a BinaryReader (BinaryWriter).
And what do you mean by "encoding"?
if it refers to the Encoding class, that one only applies to text.
if it refers to the way pixels get represented, that one is called PixelFormat.
Please learn to ask questions properly.
And don't say "it didn't run and OS complained invalid image", show the code and the exact compile-time or run-time error message(s).
|
|
|
|
|
|
No I do not understand you, you fail to provide necessary information and ask a clear question.
And no I did not suggest anything would be possible or impossible, as it is still completely unclear what you want in the first place.
Now stop reading things that are not present; and start providing information that is necessary but missing.
|
|
|
|
|
Covean did - learn post only if you have something to offer mate
dev
|
|
|
|
|
Please don't remove any messages that have been replied to. It is against the forum guidelines as it results in messy threads.
Yours said:
thanks yes you understand me - i will post the code but you're suggesting this can't be done in dotnet?
which is what you also replied to Covean !?!?!?
|
|
|
|