.net-3.5

How can I split a string between multiple delineating characters?

我只是一个虾纸丫 提交于 2019-12-24 02:04:22
问题 I'm working on a program that will parse off chunks off data from a CSV file, and populate it into the attributes of an XML document. The data entry I'm working with looks like this...e11*70/157*1999/101*1090*04. I want to break that up, using the asterisks as the reference to split it into e11, 70/157, 1999/101, etc; so I can insert those values into the attributes of the XML. Would this be a situation appropriate for RegEx? Or would I be better off using Substring, with an index of *?

GroupPrincipal.IsMemberOf always returns false

谁都会走 提交于 2019-12-24 01:18:30
问题 I have a function that checks if a group is a member of a group. I have 2 variations of the function, neither work as expected: public bool IsGroupGroupMember(GroupPrincipal gp, GroupPrincipal pgp) { return gp.IsMemberOf(pgp); } AND public bool IsGroupGroupMember(GroupPrincipal gp, GroupPrincipal pgp) { if (gp != null && pgp != null) { return pgp.Members.Contains(gp); } else { return false; } } Both look promising, however always return false. When it comes time to call the GroupPrincipal

ClickOnce download fails unless end user has VS2008

烈酒焚心 提交于 2019-12-23 20:21:56
问题 I'm still working on the problem described here, trying to get ClickOnce to work from Visual Studio 2008. I originally assumed the problem was related to the fact that the application I was deploying was upgraded from 2005. But that's not the case. I created a new VS2008 application and deployed it with the same result. I've tried (I think) every possible combination of publish settings (except signing the manifest, which I don't need to do because I'm deploying over an intranet). Most users

Unable to Add .net 3.5 Website to IIS Express

心已入冬 提交于 2019-12-23 20:01:02
问题 So, my issue is that I have a fairly large ASP.NET 3.5 project that I am trying to run locally using an IIS Express installation. I am one of many developers on my team who run this and other projects using IIS Express, and I actually run a .NET 4.0 site (complete with local SSL) on a daily basis with no issues. For reference, my machine runs Windows 7 Ultimate 64-bit with Microsoft Visual Studio 2010, and I am the administrator on the local machine. Visual Studio runs with administrative

SOAP with Attachment / MIME content

℡╲_俬逩灬. 提交于 2019-12-23 19:30:08
问题 Need to send and receive a SOAP message in the following format from a third party: POST /api HTTP/1.1 Host: mytesthost.com Content-Type: multipart/related; boundary="aMIMEBoundary"; type="text/xml"; start="<soap-start>" Content-Length: 2014 SOAPAction: "" --aMIMEBoundary Content-Type: text/xml; charset=us-ascii Content-Transfer-Encoding: 7bit Content-ID: <soap-start> <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope xmlns:soap- env="http://schemas.xmlsoap.org/soap/envelope/"> <soap

Excel 2007 VSTO plugin exception when setting Font.Color

会有一股神秘感。 提交于 2019-12-23 18:55:31
问题 I am working on an Excel 2007 VSTO plugin that is throwing COM exceptions on the client but not when debugging on my development machine. What the plugin does is capture Excel's Startup event, define a specialized style, then add an event handler to the SheetChange event. Anytime a value is changed in the sheet, the cell is set to the new style. All of this is to provide users a way to see the cells they've changed. Code is as follows: private void ThisWorkbook_Startup(object sender, System

Changing Currency Symbol location in System.Globalization.NumberFormatInfo

丶灬走出姿态 提交于 2019-12-23 18:52:52
问题 I created a CultureInfo object using new CultureInfo("fr-FR"). Now I have a number that I want to call .ToString("C", FrenchCultureInfo). The resulting string puts the € AFTER the number. Why? CultureInfo french = new CultureInfo("fr-FR"); double value = 1234.56; string output = value.ToString("C", french);//output = "1 234,56 €" From all I've seen, the Euro needs to be on the left, and my business requirements mandate that it is on the left. However, there is no way to programmatically set

Problems executing compiled 3.5 code on a server which only has the 2.0 framework

℡╲_俬逩灬. 提交于 2019-12-23 17:11:09
问题 I can't seem to get my application up and running on my dev server and I'm not sure why. I have compiled my code in VS 2008 with a target framework of 3.5. I am using 3.5 mainly because I have implemented LINQ rather extensively. Compiling and runs local without any problems. The hang up is that my server only has the 2.0 .Net framework and upgrading to 3.5 is apparently not going to happen. I was under the impression after doing some research that as long as I was trying to execute compiled

Should any domain object, not be serializable?

情到浓时终转凉″ 提交于 2019-12-23 16:45:51
问题 Is there a way to just tell the compiler, that I want my objects to be serializable by default? 回答1: Pretty much every serialization engine is going to want to know that your objects are suitable. This can take the form of: [Serializable] / ISerializable ( BinaryFormatter , SoapFormatter ) [Serializable] / IXmlSerializable (and public ) ( XmlSerializer ) [DataContract] / [MessageContract] (or most of the above) ( DataContractSerializer and variants) AFAIK, there is no way of avoiding this

C# winform how textbox became null on button click second time?

眉间皱痕 提交于 2019-12-23 15:35:26
问题 In a form I have group Box which contains tab control with 4 tabs. In the second tab I have some textboxes and before saving data I need to validate input entered in these textbxes. Please note my save button is in last tab. The following test scenario works: Invalid input in first textbox Invalid input in second textbox Click button However, in the following test scenario an "Object refrence not set to an instance of a object" exception is thrown: Invalid input in first textbox Click button