The trick and the easiest way in C# is to use the System.IO.Path class. You can simple use this code: string fileExtension = System.IO.Path.GetExtension(fileLocation); In order to find the file name use this code: string fileName = System.IO.Path.GetFileName(fileLocation); In order to get a file directory use this code: string dirName = … [Read more...] about How to get file extension, file name, file directory in C# (csharp) based on a file location?
You need to produce high quality C# code. Here are some rules you may follow. Keep everything simple and clean whatever you do. Avoid complex coding that brings a lot of your attention to it. If this is your case, because the structure of the task you are working on is complex, then use your time for analysis and divide your problem to subtasks. Be consistent whatever you … [Read more...] about Simple rules for writing tidy, clean, well tested and documented C# code
For Microsoft SQL Server here is how you can organize insert into a table in a loop: CREATE TABLE dbo.Test#1 ( blob varbinary(MAX) constraint FILESTREAM NULL ) GO declare @i int; SET @i = 0; while @i < 14 begin INSERT INTO Test#1 (blob) VALUES (cast(replicate('123345678901234567890',203) AS varbinary(MAX))); SET @i = @i + 1; end; GO Thanks. … [Read more...] about Microsoft SQL Server insert into a table in a loop
What is .NET Framework garbage collector? It is an automatic memory manager that handles memory allocation and release for .NET Framework’s native objects — managed objects. NET Framework’s garbage collector cannot control the memory allocation and release of so called “unmanaged” objects. Can I call .NET Framework garbage collector explicitly? You call GC.Collect method to … [Read more...] about .NET Framework garbage collector
Here are the links to the excellent online tools for generating cool Web 2.0 Images: Stripe Generator 2.0 Currently in BETA stage—allows you to create cool stripe tiles. GOOD: * One can add multiple stripe colors to achieve cool visual effects. * Free to use. Note that the size (width and the height) of the generated image equals … [Read more...] about Online Web20 image generators