.net-3.5

How to impersonate a Windows built-in Administrator role for a WinForms, C# App?

It seems like the elevation of privileges is a common thing most developers fight with as most of the time they simply do not have it. I for one do but am fighting with a massive Background Worker routine and I'm trying to keep my code local to the class that will be employing it. Given the amount of code and references my background wor...

A question about the ProcessStartInfo class and the Argument Property?

Some sample code: var psi = new ProcessStartInfo(); psi.FileName = "path to update.exe"; psi.Arguments = "arguments for update.exe"; psi.Verb = "runas"; var process = new Process(); process.StartInfo = psi; process.Start(); process.WaitForExit(); Ref: 0xA3. Programmatically in code what type of objects if possible could you pass ...

How to get current user using WSS 3.0 & Membership provider inside ItemDeleting event receiver method?

Hi, I need to get current user name in my Wss 3.0 application. What is more I would like to do this inside ItemDeleting method which is inside event receiver for SPList. I've tried SPContext and HttpContext objects but they doesn't work. I have to add that I'm using Membership Provider and SQL Role provider. I'm not using Active Directo...

How to add link to error message within ItemDeleting event receiver method?

Hi, I have an SPList event receiver method like: ItemDeleting(ByVal voHttpContex As HttpContext, ByVal voProperties As Microsoft.SharePoint.SPItemEventProperties) To block unwanted operation i uset this code: voProperties.Cancel = True voProperties.ErrorMessage="This is my error message." After executing above code error message w...

XSLT copy with modifications

Hi I'm stuck trying to work within these constraints, I'm using XSLT 1.0 {under .net}. I'd like to be able to do the following: i'm xsl:for-each'ing through a set of nodes of type <node> <data> unknown unstructured xml </data> <owner></owner> </node> i'd like to be able to output <node> <data> unknown unst...

Inconsistent time zone in results from Web Service

I have a web service for a production application that is returning different results to different clients for the same inbound request. I discovered this by configuring my clients to dump the raw WCF messages to trace files, which I then compared. For one client machine, the response includes date/times targeted at time zone +13:00 - ...

Making an asp.net application IPv6 compliant

We have Windows 2003 Servers running SQL Server 2005 and .NET 3.5 [separately]. We have a basic ASP.NET app running on IIS 6. What, if anything, do I need to do on the application end [IIS,Framework,ASP.NET] to make it IPv6 compatible? EDIT: We do use System.DirectoryServices, System.DirectoryServices.DirectoryEntry and DirectorySear...

GPS signal strength calculation in windows mobile

Hi, I need to show a bar in the UI indicating the GPS signal strength. How can this be done in windows mobile? Do i have to calculate average of the signal strength of all satellites in view? Apart from this do i have to consider the PDOP value? Wont PDOP value alone suffice to show the bar in UI? Is this data need to be combined wit...

Installing IIS after .NET Framework

I already have installed visual studio 2008.After that i installed IIS.so how can i configure IIS to work with .NET ...

Logging state of object. Getting all its property values as string

public class Address { public string AddressLine1 { get; set; } public string AddressLine2 { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } } ...... var emp1Address = new Address(); emp1Address.AddressLine1 = "Microsoft Corporation"; emp1Address.AddressLi...

How to make .exe file programmatically set to run as admin always in vista?

I have written a winform application in C#. When I run the program for some functionality it required admin permission. After Installation If I set the .exe file to run as admin manually (by clicking right mouse button on .exe file) then my program run perfectly. Now I need user not to set the run as admin property after installation by...

Renaming of class property that is marked with a DataMemberAttribute

Actually i have a class like this [DataContract] public class Item : IExtensibleDataObject { [Browsable(false)] public virtual ExtensionDataObject ExtensionData { get; set; } [DataMember] public string ID { get; set; } [DataMember] public string Name { get; set; } public Item() : this(String.Empty,...

Windows Service

Hi, I'm trying to write a small Windows Service in .NET 3.5, that check every 10mn or so if thee are new files in "C:\demofolder", then send e-mail out. So far, I made it to here like in the following code, then there's error in Public Sub New() Imports System Imports System.Timers Imports System.ServiceProcess Public Class TestMyServi...

How do I get the Setup Wizard to stop downloading .net 4 Client Profile?

I have a web application which is entirely .net 3.5. I have created a Setup project using the wizard making sure that I selected 3.5 from the targeted famework. When I have built the setup.exe and the Windows Installer Package and I have tried to install it on a test machine it prompts straight away to download and install the .net fra...

Smartphone win Application 's combobox load problem ...

Am working on smartphone application. Here I have a combobox which loads when the value of another combo gets changed. private void cmbTreatmentType_SelectedIndexChanged(object sender, EventArgs e) { MasterData lData = new MasterData(); cmbTreatmentCategory.DataSource = lData.GetTreatmentCategories((int)cmbTreatmentType.Select...

How to set the DataTextField property ?

In .Net 3.5 and VB.NET VS2008 How to set the DataTextField property in this link: http://www.brainbell.com/tutorials/ASP/Simple_Databinding.html It says: Now update the page to build a list of TechnologyDescriptors and to attach the collection of TechnologyDescriptors for each control. For each control, set the DataTextField pro...

A question about writing data to a custom section?

Hi guys, below is my class thanks to the article found at: URL: Derik Whittaker My Code: public class FavsSection : ConfigurationSection { public override bool IsReadOnly() { return base.IsReadOnly(); } public FavsSection() // default Constructor. { } [ConfigurationPro...

Winforms Databound ComboBox doesn't update when close Window

I have a combobox that is databound and updates with no issues. The problem I have is if the user types something into the combobox and then uses the [X] close button in the window without tabbing out, the data is not updated. I've been looking all over the web, but can't find any relevant help/tips. The only idea is have is to force an ...

.NET 3.5 with Service Pack 1, .NET 3.5 SP1, .NET 3.5.1, .NET 3.51. Are they all the same thing?

I'm researching version info about .NET Framework 3.5 and I have 3 questions. 1) My web searches turned up several names: .NET 3.5 with Service Pack 1, .NET 3.5 SP1, .NET 3.5.1, .NET 3.51. Are they all the same thing? 2) My Registry shows I have .NET 3.5 SP1 installed (version 3.5.30729.4926). If I use Visual Studio 2010 to develop ...

How to load .net3.5 "DropShadowEffect" on .net3.0&4.0 system while targeting 3.0?

Hello, I am using the System.Windows.Media.Effects.DropShadowEffect that has been available since .net 3.0 sp2 and .net 3.5 sp1. Now I'm getting errors from systems that have only .net 3.0 and .net 4.0 - they get: TypeLoadExcpeption Could not load type 'System.Windows.Media.Effects.DropShadowEffect' from assembly 'PresentationCore, V...