Click here to Skip to main content
15,895,084 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 Updated

Convert 

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...
3 Dec 2010 by #realJSOP
Should go something like this:private Sub button1_Click(object sender, System.EventArgs e) handles button1.Click AddHandler me.capture.FrameEvent2, Capture.HeFrame(this.CaptureDone) me.capture.GrapImg()End Subprivate Sub CaptureDone(System.Drawing.Bitmap e) ...
16 May 2011 by #realJSOP
http://geekswi...
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();
1 Dec 2011 by #realJSOP
You might want to look into using the FreeImage library or the ImageMajik library. I'm pretty sure one or both of them can handle images that size (GDI+ is the reason you can't do it in native .Net).Google is your friend.
26 Jan 2017 by #realJSOP
str = str.Replace("'", "\"");
11 Sep 2012 by _Amy
The PDF file is structured to allow Adobe Acrobat to display and print each page on a variety of screens and printers. You will have to read the file and then only you can store the file content in database. Refer the links below:PDF File Analyzer With C# Parsing Classes[^]Displaying the...
11 May 2015 by _Asif_
Check this out. How to convert a structure to a byte array in C#?[^]
26 May 2015 by _Asif_
Try regular expression with [0-9]+. There are tons of information present, you just need to google!Regards,Asif
19 Nov 2013 by _Maxxx_
I don't know xojo.However, if it is a simple app, you already have some xojo skills, and xojo seems that it will enable you to have both the desktop and web app with a common code base, then I would stick with that.Developing in PHP or ASP.NET or whatever else would seem to me to require...
6 Jun 2012 by Abhi KA
i need to convert the sqlDataReader to String for the comparing of database value to user entered text valuehow to do?
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...
20 Sep 2012 by Abhinav S
Take a screenshot of the form and then convert this bitmap image to a pdf using PDFSharp or any other converter.
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.
20 Apr 2014 by Abhinav S
Use the function ToOADate()[^].
8 Jul 2014 by Abhinav S
int.Parse(TxtId.Text);This line is probably throwing an error.If you try and parse a non-integer value into an integer, you will get an error.To avoid these erros, try and use Int.TryParse[^].This can confirm if the value is an integer before parsing it into an integer variable.
27 May 2012 by adam213
Dim sql As String = "INSERT INTO student VALUES(@Photo)" Dim cmd As New SqlCommand(Sql, con) Dim ms As New MemoryStream() PictureBox1.Image.Save(ms, PictureBox1.Image.RawFormat) Dim data As Byte() = ms.GetBuffer() Dim p As New...
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
13 Jul 2014 by addy25
Hey guys,I want to send a test message out to a list of people, however I want the message personalized each time.This ive done however im getting two errors in with my code:1:The best overloaded method match for Mailing.Mailing.SendEmail(string, string,...
16 Jul 2012 by aditya behara
You can use System.Speech dll. It is very good. You have methods which will take care of this task. Also the accuracy level for speech to text which I observed was not upto the mark.Further it provides some methods to select a speaker, pace at which text has to be read etc etc
17 Jan 2014 by agent_kruger
How to programmatically convert a VS 2010 project to VS 2008 project? if not programmatically how to do it manually (Prefered if done programmatically).Thanks In advance and sorry as i don't have any knowledge about converting so i cannot post the code.
7 Feb 2014 by agent_kruger
How to convert a folder into string not file into string without use of 3rd party software such as win rar etc. Thanks in advance
22 Feb 2014 by agent_kruger
as i said in the question no use of 3rd party software but i think i have to go for 3rd party software.
1 Mar 2014 by agent_kruger
I have a "2.17 GB" file and at the time of conversion it gives error.Non-negative number required.Parameter name: count. I know because the file's byte is too large for integer. But How to solve this?OpenFileDialog f = new OpenFileDialog();f.ShowDialog();if (f.FileName != null &&...
2 Jun 2014 by agent_kruger
I have a unicode number "U+2602", how to convert it into it's particular symbol or charachter and then again convert it back to unicode number? Symbol of the above unicode number is :- (Please see in the link below) https://www.dropbox.com/s/9n8v8rs383he7e3/Unicode%20answer.png[^]
8 Jun 2010 by Alain Rist
You might have considered using ::GetComputerNameA() which does the conversion for you:std::string GetSystemName(){ CHAR sBuf[MAX_COMPUTERNAME_LENGTH + 1] = {0}; DWORD dwLen = MAX_COMPUTERNAME_LENGTH; ::GetComputerNameA(sBuf, &dwLen); return std::string(sBuf);}Note...
8 Oct 2010 by Alan N
Hi, I think your expectation is incorrect. Test your assumption, e.g.class Program { static void Main(string[] args) { ShowBytes(0.0F); ShowBytes(1.70141183E+38F); } private static void ShowBytes(Single s) { Byte[] b = BitConverter.GetBytes(s); ...
14 Nov 2022 by Alan N
For me it just works and with a hard coded directory path I get an exact clone of the RH panel of File Explorer. However I can't understand your compiler error. I'd suggest that you clean the solution, delete the content of that method and type...
31 May 2011 by alessandro.campagna
Hi,I have the following example values: and I need a function or something else to get a correct time value (hh:mm) like: Does exists a method in C# to do that?Please help me, I gonna to be crazy on this!!Thx!Cheers..Alessandro
22 Apr 2010 by Alexei Shamov
Convert types, parse and evaluate expressions in runtime, in .NET 2.0
10 Mar 2013 by ali_heidari_
find main method wich is first method to start debug !write this line : System.Windows.Forms.Application.Run(new Form1()); // i consider Form1 is your windows form classthis line will make your windows form and will show it !do not forget to add System.Windows.Forms to your project...
17 Oct 2013 by Alireza C
I want to show how we can export data from data table to Excel simply.
5 Apr 2014 by alireza_raf
i want to convert this statements to logic symbol like :(a->b)^(~b) but i can't,please help mea) if i pass this course and make an A then i pass this course or i make an Ab) if i pass this course then i make an A and i pass this course and i do not make an A
15 Aug 2020 by Alpit_Abrol
import RPi.GPIO as GPIO class keypad(): def __init__(self, columnCount = 3): GPIO.setmode(GPIO.BOARD) # CONSTANTS if columnCount is 3: self.KEYPAD = [ [1,2,3], [4,5,6], ...
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
12 Nov 2012 by AmitGajjar
Hi,You can use Dynamic of C# 4.0 feature. that may help you to generate object on the fly.I found one link that may help you,Converting XML to an dynamic object using ExpandoObject[^]Best luck.
22 Aug 2012 by Amith4444
It should be:String input = sr.ReadToEnd().Replace("\uFFFD", "\x0A");
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...
20 Apr 2014 by Andreas Gieriet
Do somethnig like the following brute force approach:int calulate_day_number_since_19000101(int year, int month, int day){ int days = 0; for (int y = 1900; y
16 Jun 2015 by Annisa Kartikasari
I'm doing my final project about hand gesture recognition using OpenCV in Android. So far I did until Convex Hull. Now, I want to draw convexity defect on it and get the defect value from it. But I am stack. I found some references codes, but most of it written in C++ code. I have no idea how to...
16 Feb 2010 by Antal Dominik
Hello!Iam quite new here, and I have a problem.Iam a begginer in C#. I want to write a console app, which can send email.I have a VB source code, and I cant translate it to C#, so:-Does anyone know how to translate/convert this VB source code to C#?Thank you very much!Imports...
17 Feb 2010 by Antal Dominik
Thank you guys! You helped me alot! :D
25 Oct 2011 by Anuja Pawar Indore
Refer thishttp://code.msdn.microsoft.com/Text-to-Speech-Converter-0ed77dd5[^]
6 Oct 2017 by AP_UK
Hi everyone,Basically I am working on a project that is currently calculating the PSNR (peak signal noise ratio) of 2 images (one is the original and the other being the colour quantised one). In order for me to calculate the PSNR my images need to be in bitmap format, now for ppm I...
18 Nov 2014 by Archemendo
Your path must be full name consist of your doc also. Try this;private string path = @"D:\archemendo\doc\";private string fileName_word1 = "Arche.docx";public void WordTest() { document.LoadFromFile(path + fileName_word1); RunWordFile(path + fileName_word1);}public...
13 May 2015 by arunsiddhu1992
I have a textbox 'Mobile'. I'm using a C# code to check if the entered value is a number or not. But it only checks upto 9 digits. And I want 10 digits to be checked i.e. Mobile Number.aspx
21 May 2015 by arunsiddhu1992
I have two textboxes one contains date from database and another is to append time into it. TextBox Date = new TextBox(); Date.Text = "11/05/2015"; //dd/MM/yyyy TextBox txt1 = new TextBox(); txt1.Text = "12:00:00"; ...
26 May 2015 by arunsiddhu1992
I have a string as 'MR000000001'. Also the string value can vary from 'MR000000001' to 'MR999999999'.I want to extract the numeric value form that string.I tried TryParse method but it does not work.Please help me out.Thanks in advance.
13 Jul 2014 by ashok rathod
Change this line withSendEmail(emailSubject, emailText, p.EmailAddress );withSendEmail(emailSubject, emailText,p);this will solve both the above problems
25 Sep 2012 by Ashraff Ali Wahab
You text box contains the Base64(http://signature.freresdekor.fr/imgcsharp[^]) representation of the image.What you can do it take the entire text from the textbox, covert them to byte array using the below code and pass it to your converter.byte[] imgStr =...
11 Oct 2013 by ASP.NET Community
I have seen most of the developers using parseInt to convert a string to a number. Here we need to understand that What does this parseInt will do,
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
4 Feb 2011 by AspDotNetDev
Thought I'd suggest an alternative since you cannot create an implicit conversion operator from Object. You can create a constructor that accepts an Object, then perform any initialization there. It's not perfect, but I think that's the best you're gonna get (you could also create a shared...
23 Apr 2015 by BacchusBeale
For C, something like in the comments:def asallar(limit): \\ void asallar(int limit, int* asal_listesi){ limitn = limit+1 \\ int limitn =limit+1; asal_degil = [False] * limitn \\ int *asal_degil = malloc(...) asal_listesi = [] \\ vector asal_listesi; for i in range(2,...
26 Jan 2017 by bahman01
For a sql string to be sent in C# I need to convert ' character inside the inside the string to " character.What I have tried:I tried to replace the characters in C# but I couldn't.
13 Feb 2014 by Bajpangosh
CREATE PROCEDURE [dbo].[Insert_User] @Username NVARCHAR(20), @Password NVARCHAR(20), @Email NVARCHAR(30)ASBEGIN SET NOCOUNT ON; IF EXISTS(SELECT UserId FROM Users WHERE Username = @Username) BEGIN SELECT -1 -- Username exists. ...
15 Dec 2011 by Balakrishnan Dhinakaran
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[] alphabet; ...
17 Oct 2013 by basurajkumbhar
"select Recordno, uhnumber,uhbuilding,uhlocation from hydrantmaintain WHERE CONVERT(DATE,unndate)= '" & Today.Day & "'"You can try this .I Hope this will help you.
21 Jun 2013 by bayotle
I can't remember executing a shell directly, my programs builds them on the fly.Try the following and see if it works....shell chr(34) & "C:\Program Files\Freeware PDF Unlocker\unlockpdf.cmd" & chr(34) & chr(32) & chr(34) & "C:\Documents and Settings\USER001\Desktop\00000001.pdf" & chr(34)
10 Apr 2013 by bEGI23
Hi people im trying to create an UI Application on which is shown what the User actually types and which will be shown on the Window of the Application, to say like a Bar on the top of the Desktop, on which the typed Keystrokes are presented and which will continuosly move from right to the left...
13 Aug 2020 by Ben Crockett
Cant figure out how to convert 2020-07-14T03:10:01 into datetime.. help! What I have tried: convert(datetime, dda2.transaction.timestamp,103) + CAST(dda2.transaction.timestamp as DATETIME) This isn't working
26 Apr 2012 by Bernhard Hiller
NAudio can do alot of conversions, and it comes with source code:http://naudio.codeplex.com/[^]I expect that you can then figure what to do next.
14 Aug 2014 by Bernhard Hiller
Learn copy/paste! The Guid for word.application is {000209FF-0000-0000-C000-000000000046}, not{0002095FF-0000-0000-C000-000000000046}Make sure that a 32bit version of Word 2007 or later is installed on the target machine. The Interop dlls do not install Word!
19 Apr 2014 by bhawin parkeria
I want to convert text into link I got this->I have a textarea in which user enter description.I have table having column (name) in which there are 4 names (jack , drake , joey , pacino).Now , if any word in the text the above 4 word , the text gets automatically changed to a ...
20 Nov 2011 by BillWoodruff
1, Search CodeProject for articles on "automating" MS Word from C#. There are many resources here.2. Search CodeProject for articles on screen capture from C#. There are many resources here, including a recent one that uses DirectX (which may not relevant to your scenario).3. Start...
29 Jan 2012 by BillWoodruff
I have to disagree with the answer by J_N above: value Types are boxed, and unboxed: see: [^].A reference Type remains a reference Type: consider this simple example:public class SomeClass{ public string someString { get; set; }}Now execute this code:SomeClass sClass = new...
17 Dec 2015 by BillWoodruff
You could use Linq to create an int[],[] Array:// requiredusing System.Linq;int[],[] jaggedArray = aList.ToArray().Select(elem => elem.ToString().Select(ch => (int)Char.GetNumericValue(ch)).ToArray()).ToArray()// orint[],[] jaggedArray = aList.ToArray().Select(elem =>...
15 Oct 2012 by Bitla Phanindra
You can chose from one of these Top Ten Online Video Converters [^]hope that helps.
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 Oct 2010 by Bob Goncalo
I also have an issue with NTGraph in C++. I can compile and run without errors, but nothing appears on the graph.I have used NTGraph with vb for years without issue, so I am familiar with the functions. Again I get no error and no action on the graph. Thanks.
3 Aug 2013 by Boris Fisher
You can check on this article:http://social.msdn.microsoft.com/Forums/office/en-US/40b2ee36-13c9-420d-a6b5-3ec5f42b09d7/converting-docx-to-pdf[^]
20 Jun 2013 by brknlpr
I am reading a binary file and one of them is in hexadecimal format in one richtextbox and the other is ascii form in another richtexbox as most of you know in hex editor when you change a code in ascii there is a change on hex form how can I access the other rtb and on which event should I...
15 Jul 2014 by C3D1
Hey Guys,i'm trying to convert a COLORREF to a Hex-CString and then back from Hex-CString into COLORREF and i've run into a small problem.Here some Code for Converting from COLORREF to a CString (Hexadecimal):This part isn't the problem.COLORREF crefColor = RGB(128,0,0);DWORD...
15 Jul 2014 by C3D1
Big thanks to Jochen Arndt for his hint.I updated my code for converting from Hexadecimal CString to COLORREF to this:CString sValue(_T("#800000"));LPCTSTR pszTmp = sValue;pszTmp++; // cut the #LPTSTR pStop;INT nTmp = _tcstol(pszTmp, &pStop, 16);INT nR = (nTmp & 0xFF0000) >>...
29 Mar 2011 by CalicoSkies
C++: Converting an MFC CString to a std::string
3 Feb 2014 by caseywalls1
MailMigra for Incredimail is fabulous software to convert Incredimail to Windows Mail. As I had used it so I can safely vouch for it & recommend it to others to try also. Open the site to know more about it http://www.mailmigra.com/incredimail/windows-live-mail.html.
27 Sep 2012 by ccodeworld.blogspot.com
Hi guys,I just got stuck with conversion of a big floating value to string format.In my program,void double_to_string(long double v){ unsigned char res[40]; // here i am using compiler library function sprintf() which will give us the string format ...
9 Apr 2011 by charles henington
Using System.Convert namespace to convert between base64 and images
13 Feb 2014 by CHill60
I believe you have to define the directionality of the parameters similar to ...CREATE PROCEDURE [dbo].[Insert_User] ( IN Username NVARCHAR(20), IN Password NVARCHAR(20), IN Email NVARCHAR(30))Note also the brackets surrounding the listNB I haven't been able to test this See...
23 Mar 2014 by CHill60
First a couple of warnings ...1. We don't normally just produce code unless the OP has tried something for themselves2. You're lucky I got intrigued by this, but I haven't made it particularly tidy - there are better ways of doing some bit and you will have to sort out the different address...
3 Jul 2014 by CHill60
Here is one technique...1. Download a free PDF creator e.g. http://www.pdfforge.org/pdfcreator[^] or http://www.cutepdf.com/[^] ... there are others2. If your free PDF creator doesn't hook to the Explorer context menu (right-click on a file to check) then set your default printer to...
14 Jul 2014 by CHill60
In your SendTestEmail code you have built up a list of people which you step through to generate the personalised message.On your first pass through this you are going to set up that message as "Dear Joe" and call the SendEmail method.But you are passing the list of people into that...
21 Oct 2014 by CHill60
See response from Max Meng on this MS TechNet link[^]Be aware that if your question starts to attract spam answers you will probably also be reported for abuse, so if you didn't intend that, then best get rid of this post
20 Apr 2017 by CHill60
If the time is showing then the data type must be DateTime - to get rid of the time just cast it as a Date i.e. CAST(LicenseExpiry AS DATE) Here's an example of what I mean:declare @demo DateTime = GetDate() select @demo --2017-04-21 09:23:45.753 select CAST(@demo AS date) --...
10 Mar 2021 by CHill60
So you want to print the value followed by the key. Ways to do that can differ whether you are using Python 2 or 3 Have a look at solutions to this post How do I print the key-value pairs of a dictionary in python[^] E.gFor i in DictValue ...
12 Aug 2012 by ChineseGuy
I want to convert a string of formula (such as a/b+c* sqrt d)to an imageLike what the following webpage does.http://www.wolframalpha.com/input/?i=3%2F2%2B%285*%286%2F%284%2F%283%2F%282%2F1%29%29%29%29%29%2F4[^]somebody provide an example or sth? thanks(Is this a clear...
27 Aug 2012 by ChineseGuy
\frac{x+y}{x-y...
20 Oct 2011 by chiru_sri
Read the excel file into dataset and convert the each row data into given XML format and save it in the database.My Excel file contains the rows : Name, Description, state , provision etc.XML template format is : [Data from excel row [Data from excel...
1 Jul 2015 by Chris La
This article explains 10 rules (steps) for replacing the recursive functions using stack and while-loop to avoid the stack-overflow.
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.
20 Mar 2010 by Christian Graus
This does not appear to be a programming question. You don't specify a language, and you seem to be talking about using external programs to try to read these files. If you're coding, as the bit about arrays seems to imply, you should find a library for YUV files, or read the file format on...
5 Jun 2010 by Christian Graus
prathameshpita...
2 Sep 2010 by Christian Graus
Your best bet is to find out the image format, RAW implies it's just raw pixel data, and using the code in my image processing articles to create a Bitmap you can access the pixels of directly, and copy in your pixel data.
10 Feb 2012 by Christian Graus
Well, if you have a question about an article, there's a forum there for that. Your vague half description of an error message is unclear. You can right click on the sln and choose properties to make sure it is not read only. At that point, you will be able to do whatever you like to that...
12 Dec 2012 by Christian Graus
What does 'does not work' mean ? It looks like you're using a third party component ( as you would need to ). Is it installed/licensed on the server ? If it is, then there's nothing else we could possibly guess without seeing the error message, to help you.
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...
7 May 2019 by Christian Graus
There's really no path from C# to VB6. Tell your friend VB6 has been obsolete for 20 years now, there's no reason to learn or use it. https://www.codeproject.com/Questions/797660/How-to-call-a-function-which-is-in-another-DLL-Win This answer explains how to call a dll function in VB6.
24 Jun 2012 by Christian Vogt
An article on a generic approach for importing text based data into objects, using Reflection. Supports mass data processing, filter, advanced processing and converting, and some other gimmicks.
27 Sep 2012 by Chuck O'Toole
Your arguments to sprintf() are backwards, the output string goes first, then the format statement, then the values to be formatted into the string. See here[^]Also, the default precision (6) is not usually adequate for very small numbers. anything e-12 is pretty small. Try something like...
20 Oct 2021 by Cinchoo
Quick tutorial on converting CSV file to JSON file using Cinchoo ETL