Click here to Skip to main content
15,886,873 members
Everything / Convert

Convert

convert

Great Reads

by Alexei Shamov
Convert types, parse and evaluate expressions in runtime, in .NET 2.0
by shijo joseph
An extension methods library which could do the equality comparison operations easily
by Amit Singh Baghel
A useful tip to export a Div to PDF (with Unicode support) with the help of NReco-PDF Generator for .NET (C#), JQuery and Handler in ASP.NET
by blitzkrieged
This is a demonstration of splicing an animated GIF (or any image) frame by frame without having to write to the disc.

Latest Articles

by Xavier Junqué i de Fortuny
Converts MathML coded string to/from plain text string
by Cinchoo
Quick tutorial on converting CSV file to JSON file using Cinchoo ETL
by rohitsies
CSV file generator using simplistic approach
by NewPast
Converting codes Focus on upgrading VB6 to VB.Net and converting C# VB.Net, and listing many other helpful converter including php, java & others.

All Articles

Sort by Score

Convert 

22 Apr 2010 by Alexei Shamov
Convert types, parse and evaluate expressions in runtime, in .NET 2.0
14 Nov 2013 by shijo joseph
An extension methods library which could do the equality comparison operations easily
21 Mar 2015 by Amit Singh Baghel
A useful tip to export a Div to PDF (with Unicode support) with the help of NReco-PDF Generator for .NET (C#), JQuery and Handler in ASP.NET
7 Jan 2011 by Richard MacCutchan
See these[^] functions, I think they will do what you are asking.
16 May 2011 by yesotaso
Checkout:1- String.Split Method (Char[])[^]2- Byte.Parse Method (String, NumberStyles)[^] (System.Globalization.NumberStyles.HexNumber for instance for Hex parsing)3- For further practice System.BitConverter[^] which seems redundant for question but maybe usefull if you are going to use...
29 Jan 2012 by Sergey Alexandrovich Kryukov
The type of your variables is a reference type System.Object (and object is an alias in language), a common base of all types. What happens with primitive types like integers?Working with reference types, you store two objects: the variable itself stored in a variable, and the reference...
11 May 2012 by Sergey Alexandrovich Kryukov
First of all, conversion from what to what? The key here is: there are three different languages involved in this question, not two. They are C++, C++/CLI and C#.You can "convert" (actually, translate directly) from C++/CLI to C# (not exactly 100%) and back, but C++ and C# are languages for...
10 Jun 2012 by Rahul.KumarSharma
Use below code: double sample1; sample1 = 123; int size; size = sample1.ToString().Length;Orint size = de.ToString().Remove(de.ToString().IndexOf('.')).Length;
14 Oct 2013 by blitzkrieged
This is a demonstration of splicing an animated GIF (or any image) frame by frame without having to write to the disc.
15 Mar 2016 by Kornfeld Eliyahu Peter
Convert numbers of any base to base10...
19 Feb 2011 by Nish Nishant
Okay, I don't get it. Why use the RTF property for plain text? Why not use the Text property?richTextBox1.Text = "Plain text";
5 May 2011 by OriginalGriff
You can't."doc", "pdf", "mp3", "avi", etc. are not data types, they are file formats. Even then, they have revisions: Word Version N can create a "doc" file, but it cannot necessarily read a "doc" file created by version N + 1.There is no control, DLL, or other item which can read any...
28 Aug 2015 by Sergey Alexandrovich Kryukov
Wrong question. First, video is not converted to audio (what it would even possibly mean?) It's just video files contain several streams, and some of them are video, and some are audio, and you can have some different kinds of streams (subtitles, for example). So, you can first extract some...
18 Dec 2016 by NightWizzard
Convert amounts to their spoken equivalents
1 Oct 2010 by #realJSOP
It appears that using a float type induces less precision, and when the resulting value is cast to an int, it rounds down to the nearest whole number. Note the following:float y = 0.04F * 100F; // 4 - without casting DURING the math operation, it's fine.int x = (int)y); // 4 - and then...
19 Jan 2011 by Toniyo Jackson
Try this,Generate PDF documents from a HTML page using ASP.NET[^]
26 Nov 2011 by thatraja
Check these threadsHow to Convert PDF, Word Doc and Excel files to JPEG using C#?[^]Convert Word document [Multi Page] into JPEG File in C#[^]convert the contents of word file to JPEG in c#[^]html to jpg with c#[^]Convert PDF to JPG or PNG using C# or Command...
30 Nov 2011 by #realJSOP
Try using Environment.SpecialFolder.MyComputer, set the SelectedPath, and then call ShowDialog(). I did the following and it worked fine:FolderBrowserDialog dlg = new FolderBrowserDialog();dlg.RootFolder = Environment.SpecialFolder.MyComputer;dlg.SelectedPath = @"d:\dev";dlg.ShowDialog();
7 Jun 2012 by Richard MacCutchan
My advice would be to throw the above C code straight in the bin and start again from scratch. There is so much that is wrong or cannot be converted directly that you are probably wasting your time trying. Go and read something like Charles Petzold's .NET Book Zero[^] to get you started.
19 Jun 2012 by Sergey Alexandrovich Kryukov
In addition to the correct answer by Tim:For deeper understanding of the problem, you should first understand that compilation is a process resulting in the loss of information. For example, if you change the text formatting of your source code, if won't effect the output executable, so the...
10 Mar 2013 by wingzero007
By keeping the same project, you can change the output type:1. Go to the properties of your project (right click on the project in VS).2. In the context menu, choose properties.3. In the window that appears, Select the Application tab (Should be the first one by default).4. Change the...
8 May 2014 by OriginalGriff
It makes sense to me! :laugh:This explains it: http://msdn.microsoft.com/en-us/library/ms178091.aspx[^]:CONVERTDeterministic unless one of these conditions exists:Source type is sql_variant.Target type is sql_variant and its source type is nondeterministic.Source or target type is...
8 Sep 2014 by cogi83
A SW to send your WAN IP and other info via email
24 Apr 2018 by Yisrael Lax
Library that provides custom casting functionality from one type to another between properties with disparate names and types
12 Jul 2020 by F-ES Sitecore
I am going to assume TContext is an Entity Framework DbContext and TEntity is an EF Entity. The "Set" method returns a dataset from that table; context.Set().Where(filter).ToList(); So you are getting a list of TContext items from...
16 Feb 2010 by Christian Graus
There are VB to C# converters, C# samples for sending mail, etc, all over the web. Also, blindly using code off the web is not a way to learn, buy a book and read it, if you're not able to convert this VB to C# then you don't know enough C# to really understand the code.
31 Jan 2011 by Manfred Rudolf Bihy
I've just taken a look at the project page at sourceforge.net and it seems to me that there isn't much development going on in recent times for Report.NET. I don't know if you need this for a commercial product or not, but please have a look here: http://itextpdf.com/[^]. For commericial use...
19 Feb 2011 by Abhinav S
You might need to understand some of the differences between richtext and plain text.Rich text.Rich text uses only an 8 bit format which allows it to use only unicode characters. However escape sequences for e.g. \u will tell the converter what to do. To convert plain text to RTF, you...
27 Mar 2011 by Wendelius
Try changing the BodyEncoding[^] property.
1 Apr 2011 by Henry Minute
All files stored on a computer are binary. So I think that you might need to edit your question to make it clearer what it is that you want to do.
20 Apr 2011 by Nish Nishant
No, you cannot cast a BSTR to a char*. Use ConvertBSTRToString. See http://msdn.microsoft.com/en-us/library/ewezf1f6(v=VS.100).aspx[^]
5 May 2011 by CPallini
A while ago I tried to convert my pizza to a camera. Unfortunately tomatoes and mozzarella didn't produce very good still images (however, they tasted good).:-)
30 Oct 2011 by steveb
In UNICODE:CString str = L"Test";std::wstring ws(str);std::string s;s.assign(ws.begin(), ws.end());
9 Nov 2011 by member60
refer:http://devssolution.wordpress.com/2011/08/23/html-to-excel-in-asp-net/[^]
19 Dec 2011 by Wendelius
Could you use cast in SSIS, see: http://msdn.microsoft.com/en-us/library/ms141704(v=SQL.90).aspx[^]
19 Dec 2011 by Monjurul Habib
Try following:Conversion of decimal and date/datetime types into custom varchar equivalentsMapping of SQL Server data types to Integration Services Data Type
24 Jan 2012 by jocko3d
The TestConversion function is not valid. The line of code "data = data & Chr(n)" uses the Chr function to build a string of characters used for the test. The problem is that the Chr function is itself bound to a code page. Specifically, it will utilize the code page that is in use by the...
27 Sep 2012 by Sergey Alexandrovich Kryukov
The question makes no sense. Everything is "binary", including your original audio file.[EDIT]After OP's (incomplete) clarification:I can only guess that you need to represent the waveform and do some image recognition, but it all depends on what you have and what you want —...
17 Oct 2012 by Dave Kreskowiak
If you're talking about converting a Windows Forms application to Flex, there is no conversion tool. The two application types are very different from each other.You'll have to rewrite the application in Flex, by hand.Though, Ensemble puts out a Visual Studio plugin called Tofino, that...
19 Dec 2012 by Christian Graus
You mean 'about internet explorer' ? It's just generated by code in the exe. If you mean an about page that a site has, it's HTML on the site.You can keep data in memory without writing it to the file system, but you don't want to do that for too long. If the data is being moved in real...
18 Mar 2013 by Joezer BH
See Marshalling C++ array in struct to C# struct[^]Cheers, Edo
9 May 2013 by Dave Kreskowiak
Or, you could just do the entire thing in Word. What you're describing is called "Mail Merge" and you can print the entire document to a PDF "printer" without a single line of code.
17 Jan 2014 by Karthik_Mahalingam
check this Converting VS2010 Solution to VS2008[^]
17 Jan 2014 by Richard MacCutchan
You don't need to convert anything. The only problem is that the solution and project files created by VS2010 are probably incompatible with VS2008. The easiest way isCreate a new empty project in VS2008Copy all the source files into the new project's directoryIn VS add the files into...
9 Apr 2014 by SoMad
I don't really know if this helps because I am not familiar with the tool you are using, but I tried pasting your SVG below and I found that CodeProject's HTML thingy is a bit picky when it comes to accepting SVG and it did not display the image until I removed the spaces and line breaks within...
14 Apr 2014 by Maciej Los
Have a look here: http://stackoverflow.com/questions/10125117/convert-pdf-file-pages-to-images-with-itextsharp[^]Quote:You can use Ghostscript to convert the PDF files into Images, I used the following parameters to convert the needed PDF into tiff image with multiple frames...
4 Dec 2014 by DamithSL
this.TimeText.Text = Time.ToString("hh\\:mm\\:ss\\:ff");
13 Apr 2015 by OriginalGriff
Don't.Never store DateTime values in a DB as a string: parse them at point of input (or as close as you can get) because only then can you tell what format the user has input them in, and that they are correct. It's far too late by the time they get to the database as they have lost all user...
26 May 2015 by Mehdi Gholam
Try :string s = "MR00001012";int val = int.Parse(s.Substring(2)); // first digit starts at position 2
30 Nov 2015 by George Jonsson
You have some strange stuff going on in your code.For example these lines:picturebox1.Image = new Bitmap(Image.FromFile(filepath));Bitmap image1 = new Bitmap(picturebox1.Image);image1.Save(Application.StartupPath + "/CanFiles/" + fileName + ".jpg",...
1 Jul 2018 by Maciej Los
You can try LinqPad[^].
10 Dec 2018 by CPallini
#include using namespace std; vector asallar(size_t limit) { vector nov(limit+1, false); vector result; for (size_t i=2; i
8 Mar 2020 by Richard MacCutchan
Sorry, this site does not provide free code conversion.
25 Nov 2020 by OriginalGriff
This is not a code conversion service: we are not here to translate code for you. Even if we did, what you would end up with would not be "good code" in the target language – they are based on very different frameworks, and what makes something...
8 Mar 2021 by Richard MacCutchan
Go to The Python Tutorial — Python 3.7.10 documentation[^] where everything is explained in clear terms.
7 Jun 2021 by Richard MacCutchan
Use the %X format type in your printf statement: printf - C++ Reference[^]
5 Aug 2021 by Greg Utas
Quickly scanning your code, I see while((choice != 1) || (choice != 2))... This will always evaluate to true and therefore loop forever. I think you want && instead of ||.
5 Aug 2021 by Patrice T
Quote: this is my C code but it keeps on executing a infinite loop Yes, you exactly designed your code to do so. In this loop, you forgot to read user input again. while((choice != 1)||(choice != 2)) { printf("invalid choice! please...
18 Jan 2022 by OriginalGriff
This is not a code conversion service: we are not here to translate code for you. Even if we did, what you would end up with would not be "good code" in the target language – they are based on very different frameworks, and what makes something...
18 Jan 2022 by CPallini
Such a code is already very C-like. You just need to use printf instead of cout using the proper format specifiers, see printf - C++ Reference[^].
18 Aug 2019 by rohitsies
CSV file generator using simplistic approach
21 Jan 2011 by Rupa1
How can i convert an .aspx page to a PDF file in button click using ASP.NET? Can anybody who knows please help me?
21 Jan 2011 by Gandalf_TheWhite
I have gone thorugh this recently, I suggest you to go with iTextSharp.I have tried many ways and finally concluded it as a best available solution.They provide very good support for Conversion.And with help of 'htmltopdf'(search this term), You will be able to convert part of HTML to...
4 Feb 2011 by Yusuf
Before you pull all of your hairs (if you have any left ;P ) let me direct your attention to the drawing board. I am not sure what are you trying to achieve by creating your own _Integer that can have NULL value. Have you heard of Nullable Value Types[^]? Is there any thing the Nullable Values...
4 Feb 2011 by Sergey Alexandrovich Kryukov
Chances are, you're doing the job already done by Microsoft, available since v.3.5 if I'm not mistaken.Please see:http://en.lmgtfy.com/?q=nullable+types+VB.NET[^]. Primary purpose of feature is exactly same as yours.Most search results on top are quite relevant, I checked...
25 Feb 2011 by Sergey Alexandrovich Kryukov
You problem is thinking as hex and decimal as of data types, hence "convert". You cannot "convert" because there is nothing to convert. There is only one integer type your working with. Hex and decimal are only string presentations of it.It looks like you need to work with separate bytes or...
17 Aug 2011 by Sergey Alexandrovich Kryukov
Most difficult part is reading PDF. It's easier to find some SDK in Java or for .NET than in the form of a COM component. Anyway, there is a number of products, mostly commercial ones; try to find one:http://en.lmgtfy.com/?q=PDF+(ActiveX+OR+COM+OR+OCX)[^].Now, you will need to generate...
24 Oct 2011 by OriginalGriff
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...A quick search using your subject as the search term gave loads of information:...
1 Nov 2011 by Kaqkk79
How about this (assuming your project is set to Unicode)?CString strMyString=L"Test string";std::string strMyStdAnsiStr = CStringA(strMyString);
22 Nov 2011 by Prasad Khandekar
Hello,I am not sure whether there exists such a tool. However you can have a image printer driver and then use the respective softwares via commandline interface to automate the printing of the files to the image printer. I definitely won't recommend use of command line via ASP.NET. You can...
30 Nov 2011 by Addy Tas
Hi,I think you need to take a look at: Environment.GetFolderPath(Environment.SpecialFolder).If you feed the result of this call to the FolderBrowserDialog you should be OK.for more detail info on the GetFolderPath: http://msdn.microsoft.com/en-us/library/14tx8hby.aspx[^]Cheers, AT
15 Dec 2011 by Joel Whatley-
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static Random newletter = new Random(); static void Main(string[] args) { string[]...
15 Dec 2011 by Firo Atrum Ventus
Those errors appears because inputletter is a System.ConsoleKeyInfo[^] and you're trying to compare it with a string.You should use KeyChar[^] property of inputletterinputletter = Console.ReadKey();if (inputletter.KeyChar.ToString() == alphabet[lol]){}
2 Jan 2012 by OriginalGriff
If they are truly identical, then yes, I would ditch one of them completely.If for whatever reasons you can't, then rather than perpetuate the problem I would be tempted to create a new third class witch contains all the properties and methods, then derive both of the previous ones from...
12 Mar 2012 by Xavier John
Converter to convert OHLC data to a larger timeframe
8 Jun 2012 by er.munishyadav
this will work in this caseif (dr["City"] != null) { objAdsProperties.City = dr["City"] as string; } else { objAdsProperties.City =...
26 Jun 2012 by OriginalGriff
Base 64 is not restricted to the hex digits - it includes upper and lower case A-Z 0-9 and (normally) '+' and '/'Base 64 is a superset of base 36, which includes only upper case A-Z 0-9I think you are confused between Hexadecimal and base 64. Check your implementation.Using Base 36 to...
12 Aug 2012 by Richard MacCutchan
Converting anything in this way requires a little thinking in advance. You need to analyse the information you are converting and figure out how high and wide it might be. For example, showing a division operation such as: 23a = -- 10requires first, two 'lines', each of which...
6 Sep 2012 by Amund Gjersøe
According to Microsoft you should be able to use BmpBitmapDecoder (or the decoder of choice). I've tested, and it worked:Stream bmpStream = new System.IO.FileStream("smiley.bmp", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);BmpBitmapDecoder bmpDecoder = new...
15 Oct 2012 by Sergey Alexandrovich Kryukov
I would recommend at open-source and multiplatform VideoLAN product:http://en.wikipedia.org/wiki/VideoLan[^],http://www.videolan.org/[^].Don't be confused: even though most people use it with GUI as a player, it works as a multimedia streaming solution and a converter, and it can be done...
20 Nov 2012 by R. Giskard Reventlov
One way is to read the file into a string and then parse the string to replace commas with a tab character except when the comma is inside a pair of single or double quotes.You will also have to handle when a comma is used as a decimal separator. So, there's a hint: now write some code and,...
25 Feb 2013 by Joezer BH
Hello Guilherme,There is no out of the box solution, as it is not clear what xml schema you need.However, that is fairly simple, since you can easily implement:1. reading the excel with C#2. create your xml file with C#Hers's an example for reading an excel:var fileName =...
15 May 2013 by Sergey Alexandrovich Kryukov
In For Each item As ListViewItem In ListView1.SelectedItems your loop variable is item. This is what you should use to extract data, but you are doing something else (I don't want to analyze what exactly, you are not using item, not even i, so it's all wrong anyway).And there is no a need to...
20 Jun 2013 by lukeer
Have the value accessible as a property in some object. Two-way-bind that property to both visualisations. Convert to ASCII or hex nowhere but in the UI part.
10 Aug 2013 by Clifford Nelson
I would look at the following article: Using DescriptionAttribute for enumerations bound to a ComboBox[^]
27 Aug 2013 by Raja Sekhar S
Try this...Declare @idoc int, @doc varchar(1000) Set @doc =''Set @doc =Replace(@doc,'\','') -- @doc value will be EXEC sp_xml_preparedocument @idoc OUTPUT,...
11 Oct 2013 by ASP.NET Community
Web.Config Convert WebFroms verison 8.0.0.0 to WebFroms verison 9.0.0.0 toSolution of 1) Close VS2) Delete all of Temporary Asp files on :(Window
16 Oct 2013 by Madhu Nair
Try modifying the Query like given below - "select Recordno, uhnumber,uhbuilding,uhlocation from hydrantmaintain WHERE CONVERT(DATE,unndate)= '" & Today.ToString("yyyy-MM-dd") & "'"
10 Nov 2013 by thatraja
Check this oneMigrating VB6 reports to NET[^]
19 Nov 2013 by Abhinav S
I guess rewriting a VB6 program in any web based language would take more or less the same time.It depends on what the team is more conversant in.One thing you could check is if the same SQL queries can be utilized in both cases.It could reduce some amount of effort.
19 Nov 2013 by Garth J Lancaster
I think they are both wrongThey need to understand the functionality of the program and all the use casesThey need to understand what architectural issues there may be, transaction rates and growth factors Then they need to design test cases for the old vs the newThen they need to work...
15 Dec 2013 by thatraja
There's no converter to do 100% conversion. You need to do Code rewrite[^]. Check this blogpost,.NET Code Conversion - Convert your code - PHP to .NET[^]
4 Feb 2014 by Richard MacCutchan
I see from your comments above that this is nothing to do with translation, you are looking to create a multi-language application. See http://msdn.microsoft.com/en-us/library/vstudio/h6270d0z(v=vs.100).aspx[^] for more information.
8 Feb 2014 by Simon_Whale
have a look at this MSDN page[^]it shows you how to compress the contents of a folder into a file
1 Mar 2014 by OriginalGriff
You can't.There is a fundamental limit on the size of any one object in .NET: 2 GB.It doesn't matter if you run a 32 bit system or 64, no one single object can exceed 2GB.Add to that when you convert a long to an int, 2GB is 80000000 hex, which will overflow an int and go negative, and you...
23 Mar 2014 by Maciej Los
It's quite often asked question. I have answered it few times. Please use SearchBox[^] at the right-top corner of this site. Member 10684287 wrote:I have several thousand emails with order confirmations from online sales. I have exported the emails to a CSV, but the body of the email is...
5 Apr 2014 by Peter Leow
letP: pass the courseA: obtain grade a a) P ^ A => P V Ab) (P => A) ^ (P ^ ~A)Propositional Logic[^]
9 Apr 2014 by The Physicist
Hi there,I am trying to convert a bunch of svg files to pdf, using the svglib and reportlab python packages.I am using a small program, that I found in a neighboring thread (Convert SVG to PDF in python[^] )So, after assembling the converter looks like this:from svglib.svglib...
16 Apr 2014 by madagaga
Converting MSSQL database to MySQL
19 Apr 2014 by Zoltán Zörgő
I have upvoted your question because you have presented an interesting problem (for me). As I mentioned in my comment, I doubt you can do something like that in a textarea. Simply because textareas do not support any formatting. You might be wondering how web based WYSIWYG editors work - well,...