I've been wondering this for a while now, and i'm not sure what the best way to deal with it is.
Basicaly, i have a scenario where data is coming into an aspx page that is tamperable by the user. In this case the Querystring.
I am creating a wrapper class that wrapps the Request and then attempts to parse and strongly type the Querystring values so i can expose them as typed nullable properties.
My question is, whether it is better to Throw an exception on parse failure, or raise an event that informs the invoking application that it failed, and then return null.
I have gone for the second solution becase of the speed over exceptions, but it's something i've been mulling over for a while now.
Generaly i'd rather raise exceptions only for programming state errors and have validation of user changable input handled more gracefully. I was just wondering what other peoples opinions on this are, and what they would recommend.
I recently moved into building more comprehensive exception models for my apps and have found that it removes a lot of the ambiguity from the code.
Does any one know how to get the file "property-value" pairs for a particular file. The property-value pairs appears in Windows Explorer when you select a file and view properties, and then select the summary tab (Advanced). My camera puts additional information (such as shutter speed and aperature settings) in this collection. I cannot view them in the "detail view" in Windows Explorer (i.e. you cannot add them to the view). I thought I would write a quick app to display these values next to each picture.
Nothing I can find in the System.IO library allows me to get at this collection. I found the DSOFile object but this only works with Ole file (excell, word, powerpoint,...)
Any ideas if it can be done with the .Net libraries?
I am trying to install .net 2.0 framework on my xp sp2, but the installtion asks for the windows installer 3.0 which is already included in xp sp2, however i downloaded windows installer 3.0 and tried to install it but it failed because sp2 is already there. Did anyone have similar problem like this? Currently I have .net 1.1 and vs2003 in my computer, do i have to uninstall it before install .net 2.0? Thank you in advance.
when i try to install windows installer 3.0 it says "Setup has detected that the service pack version of this system is newer than the update you are applying. there is no need to install this update". But i guess the windows installer 3.0 doesnt know I need it for .net 2.0.
thank you vega, the exact error message is "prerequisite programs are missing, setup has detected that the following prerequisite programs are not installed: Microsoft Windows Installer 3.0". The problem is that windows installer 3.0 wont allow me to install it. What should I do, I have tried with my spare pc which is windows server 2000, it installed perfectly.
I hope to be in the right forum with this question:
1/ I would like to create a webservice method, that returns the username of the user that executes its assembly. I hope to be clear here. Typically it would be the ASPNET user that is returned, but i want to get the exact user.
2/ I also would like to return the IIS folder in which the webservice files are installed. When i use "return Directory.GetCurrentDirectory();", then i get "c:\windows\system32". But i'd like to have "c:\inetpub\wwwroot\bin" or something like that.
Is this possible? And if so ... what do i have to do ?
I have created web service using C#, VS2005. I can browse the web service and check whether the web methods are working fine or not (on my develoment server); so far so good.
I want to deploy this web service on other host, so I created web setup project from VS2005 and created installables. I ran these installables on other host and they got added too (I checked it through IIS manager).
Now when I browse the web service I get the following error message.
"The page cannot be found.
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. "
Could someone let me know what exactly am I missing here.
I am new to both C# and web services, so any kind of help would be much appreciated.