Get Version Info Of A Patch File In C#?
Jun 25, 2010
I am uploading a .msi file using fileupload control to a central location. Now i need to get version info of this file. I am using the following code.
FileVersionInfo patchFile = FileVersionInfo.GetVersionInfo(completeFilePath)
completeFilePath is the full path of the uploaded file. This code breaks and throws file not found exception.however, if i look down in the physical directory,file exists there.
Am i missing something or will i have to download this uploaded file again to some temp location and then extract version info from this file.
Second option i had was to get version info before uploading the file. In this case i am not able to get complete path of this patch file as fileupload control just gives the fileName and not the complete location.
View 1 Replies
Similar Messages:
Jan 29, 2010
Nexus One is not currently supported by the Mobile Device Browser File, which leads to the Nexus One being identified as a non mobile device.
I know the user agent, and the capabilities are pretty similar to other Android terminals. With this information, how do I patch the MDBF to have the N1 be recognized as a mobile device?
View 3 Replies
Nov 3, 2011
I'm looking to create a page with version and contact info. I want the page to open in the parent page and to be smaller than the main page. I also want the focus to be on the "about" page till it's closed..
View 1 Replies
Apr 25, 2010
i need to get the Browser version, type of the user. i need the short name not the long one.
at the monent i have this:
browser = Request.ServerVariables("HTTP_USER_AGENT") that retuens this:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249
i need only (Chrome/4.1.249), (MSIE 8.0)...............
plus i would like to get the operating system too
View 16 Replies
Jul 22, 2010
I'm building an ASP.NET MVC 2 site where I'm currently implementing an OpenID sign-up form. Unfortunately, I'm foreseeing a possible security bug/vulnerability inside my architecture.
Here's how I want OpenID login to work:
User requests /Account/Login, Controller sends back OpenIDLogin View. User enters their OpenID into the View, then OpenID authorization takes place, and finally the OpenID is returned to the Controller.The Controller checks whether the OpenID is currently in use by a user in the system or not. If it is, the user is logged in to that account. If not, the registration process begins.
And now, the OpenID registration process:
The OpenID identifier, as well as any other information provided by the OpenID provider (such as email address or name), is put into my custom ViewModel and sent to my OpenIDRegistrationForm View.The RegistrationForm View stores the OpenID in a hidden field to make sure that it gets sent back to the Controller.The user fills in the RegistrationForm View and sends it back to the Controller.The Controller creates the user account and puts the OpenID into the database.
The bug that I see within my architecture is that a user could modify the hidden value in the RegistrationForm View. Thus, they could spoof their OpenID! I will make sure to add another round of checking to the final Registration Controller Action to make sure that the OpenID that is provided doesn't exist yet, but there is still a possibility for spoofing. Can my architecture be improved somehow? I don't want this to end badly...
One solution I'm considering is encrypting the OpenID before I send it to the View and then decrypting it when it reaches the Controller. Should I try this?
View 1 Replies
Jun 1, 2010
I have a page where im listing out the files within a directory. How can i get the path to the files that are listed?
in other words, i want the path to the file to be like this:
http://server.com/files/pdfs/mypdf.pdf
but using this string url = Request.RawUrl.ToString(); returns [ http://server.com/files/pdfs/default.aspxMYPDF.PDF ]
That file is actually within a sub directory of the pdfs folder. So the link is obvisously not correct. Ive tried other suggestions found online, but those return the link like this [ http://server.com/files/pdfs/MYPDF.PDF ] again missing the subdirectory it actually belongs to.
View 8 Replies
Mar 22, 2010
I have been thinking about the optimal way to create an XML file using data from a Dataset AND according to the rules of an XML schema. I've been searching around for a bit, and I failed to find a way in which I only take the data from the Dataset and put it inside a XML tags, with the tags being defined by an already-existing schema. So it might go like this:
1- Create Dataset and fill its rows with data.
2- Create an XML according to an XML schema rules.
3- Fill said XML file with data from Dataset such that data is taken from the Dataset while structure of the XML file is taken from the XML schema.
View 2 Replies
Jul 28, 2010
I'm trying to parse a HTML file to retrieve certain info in my asp.net app. I've looked at the html agility pack but found that also quite difficult. :-) As my HTML should be pretty standard I'm hoping regex is quick and easy. I need a regex that will look through the html file (which I've loaded into a string) and find the below line and take out the DATATOEXTRACT (which will be some sort of text, the name of a recipe in this case) so I can put it into a variable:
<span class="titleText1">DATATOEXTRACT:
</span>
View 8 Replies
Sep 29, 2010
We recently installed a patch to one of our test servers (yes it was a very old patch for a very old version of .net). After installing, it seems the ASPNET account no longer has the same privileges that it once did. I get the following error in the application logs.
"aspnet_wp.exe could not be launched because the username and/or password supplied in the processModel section of the config file are invalid."
I have tried changing the user in the processmodel config file to one that I created, but I don't think I'm setting the proper permissions on all the files and locations that are necessary. All of the other app pools that we have run fine (we have 1.1 and 2.0 on this server as well). Running the 1.0 app pool as "local system" allows the process to start correctly, but I'm afraid of the security ramifications of allowing that process so much access.
View 4 Replies
Aug 5, 2010
I have a small Access database with some fields, like: date, name, text. Those fields are stored in a record inside MS Access. I also have an PDF file available belonging to that record as described before. I like to store the title of this PDF also in this record. Clicking by an user on this title should show the PDF file in a separate form. The pdf's are all stored in a map called e:pdfs and filename can be as needed. My questions are:
1. how should i bring the pdf names inside the record (like e:pdfsumber-one.pdf ? )
2. by clicking on this name the pdf file should be showed in a seperate form?
3. clicking means probably a javascript that handles the pdf file ?
4. can anyone give me some clues? I do work with VS2010 and framework 4
View 3 Replies
Sep 28, 2010
I have a FileUpload control on my page. I would like to get hold of the "date created" information of the file
before it is uploaded. (Obviously, when you upload the file, the uploaded/copied version has a new "date created", set to the time of when you actually uploaded the file.
View 4 Replies
Jan 29, 2011
The CalendarExtender used with TextBox has a problem when you select previous years, months and a day in that the day reverts to "1" no matter what day of the month that you choose. Microsoft usually has a free patch for something like this when that happens.
If I am correct and there is a patch for this bug can anyone tell me where to find the patch and if there is no patch can anyone tell me how to solve this problem?
View 1 Replies
Jun 30, 2010
I have an ASP.NET site that uses impersonation. As the impersonated user I use a domain user (not a local machine user). The site is hosted in IIS 6 running on Windows 2003. In IIS 6 for directory security windows authentication is ticked.The site has been running now for about 6 months without any problem. However since about a week back the site has started spuring up really wierd errors. For one, users cannot access the site anymore. When accessing a windows authentication dialog box appears having the user to enter the credentials. However these credentials are not accepted and the standard unauthorized page is displayed
View 7 Replies
Sep 29, 2010
Since installing the security patch for the ASP.NET Oracle Padding vunerability any user that was keeping themselves logged in to our site is getting error messages when hitting any page.
The errors logged on the server are
System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: xxx.xxx.xxx.xxx
Port: 55796
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
ViewState: l4nsXEvWcOwlDpmdbxw916bpHoPiqdBP7Syb+zCQAv44xv/r3oLtETKTL28/Gts6
Referer: Path: /product/4795/fender-usa-deluxe-stratocaster-mn-olympic-white-pearl
With custom errors switched off a user sees the following information
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: [ViewStateException: Invalid viewstate.
Client IP: xxx.xxx.xxx.xxx
Port: 3588
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5; .NET CLR 2.0.50727; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
ViewState: s0toPCu7bxkB7a3G+KTxawY3ILf1qunZyIqNBKg8xSoqY2BkWIUCJAHKFKo2RnJw
Referer:
Path: /]
[HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +118
System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +13
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +238
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +5
System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) +90
to delete all cookies and log back in, but obviously an average user, won't know to do this and I'm worried they will just think our site is broken.
View 3 Replies
Nov 12, 2010
Are the Crystal Reports objects within Visual Studio (I'm using 2005) the full version or is it a trial version that is missing features?
View 1 Replies
Feb 25, 2011
We have an application that is already deployed in the production environment. And currently it is using Dundas evaluation version. We tried updating it to the licensed version by simply pasting the dll file. but we got the error message as "The file has not been pre-compiled and cannot be requested".
View 1 Replies
Feb 17, 2010
I have a application in which i have read the mail from outlook. its working fine in local pc . but when i deploy this application on server then it gives me error like: on deploy machine outlook version is office 2007. Could not load file or assembly 'Extensibility, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
View 2 Replies
Nov 24, 2010
i uploaded a new version of my website. and some users complained that they see some page i changed very very wrong. anyway after a refresh they see it fine. i think its because my css file got cached by them on an earlier time...why isnt the browser downloading the css file by himself on first load?..
View 4 Replies
Dec 29, 2012
I have hosted a website in the iis and when i replace the file it is not updating the file it is showing the old version.
View 1 Replies
Sep 9, 2010
I try to install vistual 2005 on Win 7 On meantime I have net1.0 sp3 developer ;net Framework 2.0 , Microsoft Device Emulator version1.0 -ENU,Microsoft Visual J#2.0 Redistributable Package( can I uninstall This package)the studin 2005, but when I try to install the update (VSBsp1-KB926747-x86-INTL) i get hte error:The update patch cannot be installed by the Windows Installer service because the program to be updated may be missing, or te upgrade patch may update a different version of the program, verify that the program to beupgraded exists on your computer and that you have the correct Upgrade patch how to deat with this problem??
View 6 Replies
Sep 26, 2010
I'm try to get my site to detect what browser someone is using to ensure they're using one that is compliant with our site. Everything works, except Firefox seems to post the wrong version in the Request.Browser variables.I'm on Firefox 3.6.10, but Request.Browser shows Mozilla 1.9.2.10. It's correct in the HTTP_USER_AGENT string:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 YFF35 Firefox/3.6.10 ( .NET CLR 3.5.30729)
Is there a way to detect it better without having to parse through the HTTP_USER_AGENT string?
View 3 Replies
Mar 8, 2011
Is there any limit on the size/numbers in the version number of the FormsAuthenticationTicket.
I tried to create an ASP.NET cookie using forms authentication, with a large version number(ex: 1234567 need this number for identification purposes). But when I decrypt the cookie I get 135 as the version number.
Initially the old forms authentication cookie was removed, in order to add new information.
Response.Cookies.Remove(FormsAuthentication.FormsCookieName);
Following is the code I used to create the FormsAuthentication cookie.
FormsAuthenticationTicket newAuthTicket = new FormsAuthenticationTicket(1234567, un, DateTime.Now, DateTime.Now.AddHours(5F), false, user_data);
HttpCookie newauthCookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(newAuthTicket));
Response.Cookies.Add(newauthCookie);
After retrieving the cookie, the version number I got was 135. This number varies with different version numbers.
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie authCookie = Context.Request.Cookies[cookieName];
if (authCookie == null)
{
return;
}
FormsAuthenticationTicket authTkt = null;
authTkt = FormsAuthentication.Decrypt(authCookie.Value);
if (authTkt == null)
{
return;
}
int versionID = authTkt.Version;
Can someone let me know if it's a bad idea to use such big version numbers, or am I missing something in this.
View 1 Replies
May 22, 2010
I have Visual Studio 2008 installed on this workstation with SQL 2000, 2005 Express, 2008 Express and I think 2008 R2 (not sure if that is a version itselve or not)
I will call that workstation HOME
I created some tables in SQLEXPRESS through VS2008.
I worked on this project on another workstation that I just installed VS2008 annd SQLEXPRESS 2008 and I know that was R2
Installed Visual Studio 2010 trial edition between the thiem I made the tables on HOME and tonight for the first time since that install
I am now getting the "cannot be opened becuase it is version Version 661. This Server supports version 655..."
What to do now?
I can opened SQLExpress 2008 management studio and it is running.
So is my SQL 2000. The problem seems to be that after the VS2010 install neither VS2008 or VS2010 can connect to the SQLExpress 2008
What do I do now?
I can't remove sql 2000 because it is tied to several 3+ gig databases that will not work in Express.
View 2 Replies
Jan 5, 2011
i am working in webapplication in asp.net using c#.I have a problem that currently i am using ajaxcontroltoolkit version 3.0.20820.0 but in this toolkit i don't have Editor Ajax control so i want to upgrade it with new version ajaxcontroltoolkit version 3.5.40412.2
When i upgrade it then my old ajax control is not working like validatorcalloutextender and requiredfieldvalidator etc.
so please tell me how can i upgrade ajaxcontroltoolkit version from 3.0.20820.0 to version 3.5.40412.2
i also use in web.config file but not successfull.
View 1 Replies
Mar 31, 2010
We have encountered this difference in file creation while using a HttpHandler Versus a Code Behind Aspx page. We are reading a saved jpg/png picture as byte array from a 'Image' field in sql server database and create a physical file in the server. Both the Aspx Page and Httphandler use the same code pasted below.
//Begin
int docID = Convert.ToInt32(Request.QueryString["DocID"]);
var docRow = documentDB.GetDocument(docID);
// Retrieve the physical directory path for the Uploads subdirectory
string destDir = Server.MapPath("../../Uploads").ToString() + "\";
string strFileName = destDir + DateTime.Now.ToFileTime() + "_" + docRow.DocName.ToString();
FileStream fs = new FileStream(strFileName, FileMode.CreateNew, FileAccess.Write);
fs.Write(docRow.DocData, 0, docRow.DocData.Length);
fs.Flush();
fs.Close();
// End
After the file is created, it is viewable as a jpg/png Image only in Aspx Code Behind. While in case of HttpHandler it is not a valid Image.
View 1 Replies