.net

delay ring between two font style changing

Hi I want to change font style of a control , for a short time. for example 2 secounds. I do like : label1.Font = new Font(label1.Font, label1.Font.Style | FontStyle.Bold); for(int i=0,i<4000000,i++); label1.Font = new Font(label1.Font, label1.Font.Style | FontStyle.Regular); but it doesn't work. what is the problem? ...

.NET Deployment Framework

Many people use Nant or Powershell for deployment of their apps to different servers/environments. These are based on scripting while some solutions allow deployment to be embedded in code like Migrator.Net and other Ruby inspired Db deployment/migration frameworks in .NET. I was wondering if there are any frameworks for .NET for appli...

ASP.NET custom server control: nested items

Hi, In the aspx code view, we can code like this: <asp:ListBox runat="server"> <asp:ListItem Text="Item1" /> <asp:ListItem Text="Item2" /> </asp:ListBox> However, the ListItem class is not a server control. How could we do that in our custom server control? That is, how to develop a ListItem-like class which can make this ma...

How to get ip address from .Net code

I just want to get the System IP address and display it on a UI.Can someone please tell the API to be used for the same ...

How can we copy the data of the datacolumn of the datatable to another datatable ?

How can we copy one datacolumn with data from one datatable to another datatable ? I have datatable like DataTable datatable1=new DataTable(); and there are four columns in that table but I want only one column.So I am doing like DataTable datatable2=new DataTable(); addressAndPhones2.Columns.Add(addressAndPhones.Columns[0].ColumnNa...

What is the best way to expose contacts from a web app so they can be consumed in Outlook / Mac address book?

Hi, We have an ASP.net MVC web app with SQL Server back end. The app manages projects and has a number of companies and contacts stored in it. Is it possible to expose this in any way so that PC and Mac clients can use this as an address book when sending email or to view contact details when off-line? I have found the following opti...

Asp net MVC controllers and widgets

As I understand it, in ASP.NET MVC a httprequest is mapped to a controller/action. As one request is used to get one web page, could we call to these controllers "page controllers"? My other question is about widgets (user controls) and RenderPartial method: If a widget represents a classic ASP.NET webcontrol or usercontrol, and I ...

How to write linq query in Entity Framework but my table includes foreign key?

I have a table it includes 3 foreign key field like that: My Table: Kartlar ID (Pkey) RehberID (Fkey) KampanyaID (Fkey) BrimID (Fkey) Name Detail How can i write entity query with linq :? select * from Kartlar where RehberID=123 and KampanyaID=345 and BrimID=567 BUT please be careful I can not see RehberID, KampanyaID, BrimID...

What algorithm .Net use for searching a pattern in a string?

I'm studying string searching algorithms now and wondering what algorithm is used for .NET String.Contains function for example. Reflector shows that this function is used but I have no idea what its name means. private static extern int InternalFindNLSStringEx(IntPtr handle, string localeName, int flags, string source, int sourceCount,...

Will HttpResponse.Filter buffer the whole data before start the sending?

Hi, An user posts this article about how to use HttpResponse.Filter to compress large amounts of data. But what will happen if I try to transfer a 4G file? will it load the whole file in memory in order to compress it? or otherwise it will compress it chunk by chunk? I mean, I'm doing this right now: public void GetFile(HttpRe...

XmlDocument caching memory usage

We are seeing very high memory usage in .NET web applications which use XmlDocument. A small (~5MB) XML document is loaded into an XmlDocument object and stored in HttpContext.Cache for easy querying and XSLT transformation on each page load. The XML is modified on disk periodically so a cache has a dependency on the file. Such an appli...

Why .NET Boolean has TrueLiteral and TrueString?

Why in Boolean type there are two fields with the same value? internal const int True = 1; internal const int False = 0; internal const string TrueLiteral = "True"; internal const string FalseLiteral = "False"; and public static readonly string TrueString; public static readonly string FalseString; static Boolean() { TrueString ...

CreateProcessAsUser doesn't draw the GUI

Hi, I have a windows service running under "SYSTEM" account that checks if a specific application is running for each logged in user. If the application is not running, the service starts it (under corresponding user name). I'm trying to accomplish my goal using CreateProcessAsUser(). The service does start the application under corresp...

Log versions of all used DLLs

I want to log the versions of all DLLs my .NET-application uses. It doesn't matter if the log-output is generated on startup or on first use of each DLL. The first solution which came to my mind was to iterate over all DLL files which reside in the same directory as my assembly. But is this the best option I have? Is there any better wa...

Where to find Helpful Silverlight Tutorial (interactive)

I want to be able to create an interactive type program where a user can pin point plots on a graph, so if a user clicks anywhere on the map a dot of some sort will be plotted. I just need a helpful tutorial on silverlight to help me do this sort of thing. I have tried looking up google but I am not finding exactly what I want. ****I a...

Which substring of the string1 matches with the string2.

There are two strings. String str1="Order Number Order Time Trade Number"; String str2="Order Tm"; Then I want to know that str2 matches with which substring in the str1. string regex = Regex.Escape(str2.Replace(@"\ ", @"\s*"); bool isColumnNameMatched = Regex.IsMatch(str1, regex, RegexOptions.IgnoreCase); I am using regex because...

GetDirectorySize exceptions

i want to create functions what get the folder size. I write small function: private: unsigned long long GetDirectorySize(String^ path) { unsigned long long size = 0; DirectoryInfo^ diBase = gcnew DirectoryInfo(path); if (!diBase->Exists) return 0; array <FileInfo^>^ files; array <FileSystemInfo^>^ files2; try { ...

How to create thumbnails from WMV video's

Hi, i want to display thumbnails for videos listed on my site, i want to fetch a single frame from a video (from a particular time) and display them as thumbnails. Is that possible using .Net ? (C# or VB) ...

Finding All Characters Between Parentheses with a .NET Regex

I need to get all characters between '(' and ')' chars. var str = "dfgdgdfg (aaa.bbb) sfd (c) fdsdfg ( ,ddd (eee) )"; In this example, I need to get 3 strings: (aaa.bbb) (c) ( ,ddd (eee) ) What pattern I have to write? Please, help. ...

Linq SqlMethods.Like fails

I'm following the tips here, trying to leverage the statement that the sql doesn't get created until the enumerator is tripped. However I get the following error on the code below. I'm using Linq2Entities, not linq2sql. Is there a way to do this in Linq2entities? Method 'Boolean Like(System.String, System.String)' cannot be used on...