|
No, there's no way to get the mime type without the extension unless you want to try opening the file and try to read it as if it's a file of the desired mime type.
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Additionally to what John said, you need to open the file and check the file header (if existent) against a list of known file headers.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Ok, and how to get the file headers?
|
|
|
|
|
Read the first n bytes (e.g. using the BinaryReader ) and see if they match any known header bytes.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Ok, I tought there was some kinda headers like in HTTP request.
I got a list of "headers", but it's mainly a trial and error method, but it seems to work for some mimetypes...so far
|
|
|
|
|
hi,
i want to add vb.net module in c# code..is it possible?..
if yes..please supply a simple example ...
Thanx.....
|
|
|
|
|
Yes it is. Simply write it and reference it just like a normal reference. Once compiled there is no difference between an assembly original written in vb.net and one written in c#
Simon
|
|
|
|
|
Well its Possible, but you should not use Different version of Visual Studio to do that, but i remember i wanted to use a C# function i created in Visual Studio 2005. So what you can do Complile your Project and reference the DLL in the other Project from your vb.net Project and that should work.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hello everyone,
When using "int", it is always 32-bit? No matter whether we make build option as Any CPU, x86 and x64?
thanks in advance,
George
|
|
|
|
|
If you want a larger (or smaller) integer, use Int64 or Int16 . An int is as big as the compiler defines it to be.
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks John,
Answer to my original question is, int is always 32-bit no matther what platform and build option (Any CPU/x86/x64) is used?
regards,
George
|
|
|
|
|
no. visual c++ 1.2 (and turbo pascal) defined an int as 16-bit. Starting with Visual C++ 2.0, an int was 32 bit.
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks John,
My context is C#. Any comments or answers to my original question?
regards,
George
|
|
|
|
|
John Simmons / outlaw programmer wrote: An int is as big as the compiler defines it to be
Wrong language John?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, it is C# forum.
regards,
George
|
|
|
|
|
George_George wrote: When using "int", it is always 32-bit?
Yes. In C# an int is always 32 bits.
The keyword int is an alias for the type System.Int32 .
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Cool, thanks Guffa!
regards,
George
|
|
|
|
|
|
Good link, thanks Greeeg!
regards,
George
|
|
|
|
|
Just to add to the pot:
The C# keyword int is a compiler accessor to the System.Int32 type. You may use the below code to validate this as an excercise on each platform:
typeof(int) == typeof(System.Int32)
The above code will return true .
/F - .NET Developer
|
|
|
|
|
Cool, thanks ElSpinos!
regards,
George
|
|
|
|
|
|
Good link, thanks PIEBALDconsult!
regards,
George
|
|
|
|
|
I have a situation where im trying to get TCP connection "netstat" type traffic from a remote machine
in the past i would have used SNMP to perform a simple get and would give me the desired listing of TCP connections however this environment does not have SNMP loaded (hardened environment)
I was thinking of using a WMI Win32_Process to start the process/cmd "netstat -nab" then pipe the results back to the reomte machine. i soon found that i couldn't pass the results back and would need to >> redirect the output to the systems temp directory of the machine and then transfer the file back using some method
has anyone else had or can advise a beter method to get the file off the machine, these machines must be agentless ie no software/code can be install on the remote machines
|
|
|
|
|
What you're trying to do is impossible if you can't put software on the remote machine.
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|