|
anyone who has tool of " c++ convert to c#" for free?
|
|
|
|
|
I don't think it's *that* simple as there are different variations of C++, and sometimes C++ reaches parts that C# just can't reach.
This post[^] may be a posssible way?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
There is an online converter:
<a href="http://code2code.net/">http://code2code.net/</a>[<a href="http://code2code.net/" target="_blank" title="New Window">^</a>]
We have a 'demo' edition of our C++ to C# converter, which will convert up to 100 lines at a time 'for free'.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
Hi,
I am currently writing a program to automaticly encrypt PHP code.
Hovewer, I need to find every occurences of php code (<?|<?php //content ?>) and loop through the contents of this.
So...
If I for example enter the string:
Testing
<?
echo "test";
?>
<?
$variable = "another test";
echo $variable;
?>
The script should find the two occurences of PHP code, and return them in two messageboxes.
The first one should return MessageBox.Show("echo \"test\";"); etc.
So, find the PHP tags, loop through them (a for loop, I assume), and then put the contents into a string variable (so I can just say MessageBox.Show(phpText);).
Does anyone have a clue on how to do this?
Thanks.
|
|
|
|
|
Im not very sure about real code for you now, but i suggest you should take a look into Regualar Expressions. Regular expressions let you identify portions of strings, characters or even patterns of strings in given source strings (e.g. tag-like structures). You can even replace strings of an expressed pattern in a given source string.
.Net supports Regular Expressions since the earliest versions. I guess it will suffice. Ask Mr. Google about examples of regular expressions...
Sory bro, that I cannot give you any real code. However, i hope my answer leads you to a solutions.
Best regards
Trollpower
|
|
|
|
|
Yeah.. I know regex's (I've been writing PHP's for years now ).
Just don't know how to do it in C#, I would do it like this in PHP:
preg_match_all("#<? (.*?) ?>#si",$content,$matched);
modified on Friday, December 19, 2008 8:44 AM
|
|
|
|
|
The MSDN website has a good explanation of the regular expression capabilities in .NET. [^]
99% of what you know will transfer from PHP. The most obvious differences are that you do not start and end the pattern with a delimiter character and that you specify expression options (like the si at the end of your expression) differently. There are also some advanced things you can do with .NET regular expressions, but you probably will not need them here.
As for looping through the matches, you will probably use a while loop
using System.Text.RegularExpressions;
string phpFileText = ;
Regex matcher = new Regex(,
);
Match code = matcher.Match(phpFileText);
while (code.Success)
{
code = code.NextMatch();
}
PS: don't forget that ? is a quantifier in regular expressions, so you need to escape them when searching for a literal ?
|
|
|
|
|
I want to find column index of particular column in DataGrid by just passing column value.Is it possible.
If anyone knows please reply,
Thanks.
|
|
|
|
|
Yes, but what happens if more than 1 column or row contains the value? You can find the column index by iterating throught he ciolumns and rows.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hello all
I have an application in c#. which i want make in as a plugin .... to eclipse
is this posiible ?
if so how ?
kindly plz provide me with some suggestions
Thanks
TJS
|
|
|
|
|
I expect the best place to start would be the eclipse web site or their tech support to see how you define a plugin to their app.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I've object and it has a lot of objects
When I access Childobjects everything is ok but not MemoryStreams;
public class myObject
{
public List<ChildObject> subObject = new List<ChildObject> { };
public string ObjectName { get; set; }
public class ChildObject
{
public string ChildObjectName { get; set; }
public MemoryStream ChildStream { get; set; }
}
}
When I use this object I am using following code;
MemoryStream myMS = new MemoryStream();
myMS.Position = 0;
myObject MyObj = new myObject();
MyObj.ObjectName = "My First Object";
MyObj.subObject.Add(new myObject.ChildObject());
MyObj.subObject[0].ChildObjectName = "My First Sub Object";
MyObj.subObject[0].ChildStream.Position = 0;
Thanks for your reply.
|
|
|
|
|
Indeed - you've not provided the error message you're getting.
Hold on though - I'll use my psychic powers.....
"Object reference not set to an instance of an object"
ChildStream has not been instantiated.
MyObj.subObject[0].ChildObjectName = "My First Sub Object";
MyObj.subObject[0].ChildStream = new MemoryStream()
MyObj.subObject[0].ChildStream.Position = 0;
|
|
|
|
|
Impressive
Is it possible to auto create this MemoryStream in my subClass's constructor?
When I Create following...
MyObj.subObject.Add(new myObject.ChildObject());
I want to use this MemoryStream directly.
Thanks
|
|
|
|
|
Sure, just add a constructor to ChildObject and instantiate the memoryStream therein.
|
|
|
|
|
Thanks for your help. This is work for me.
Final solution as like these;
public class myObject
{
public List<ChildObject> subObject = new List<ChildObject> { };
public string ObjectName { get; set; }
public class ChildObject
{
public string ChildObjectName { get; set; }
public MemoryStream ChildStream { get; set; }
public ChildObject()
{
ChildStream = new MemoryStream();
}
~ChildObject()
{
ChildStream.Dispose();
}
}
}
|
|
|
|
|
You may also want/need to implement IDisposable on your class to
have more control over the lifetime of that stream (and it's
associated memory).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I've got a large class in c++. I couldn't convert to C#.Because i don't know a lot of construction and contents in this class. I want to import this class to c# app. Can my problem solve in C#. How do I import c++ class to C#.
I hope I can communicate my problem more rihgt.
thanks
|
|
|
|
|
You have two choices, either put it in a dll, and import the functions like you would with any other dll, or make a managed c++ wrapper around your class that converts the managed types to unmanaged, and vice versa.
|
|
|
|
|
I am getting this error...
Unable to cast object of type 'System.Web.UI.WebControls.LinkButton' to type 'System.Web.UI.WebControls.Button'
how i solve this problem..
Thanks.
|
|
|
|
|
Why are you trying to do that?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
i am getting error in this foreach loop...
ButtonList contains List of Buttons and LinkButtons.
foreach (Button str in ButtonList)
{
}
|
|
|
|
|
I just took a sleeping pill and can't think clearly, but this could work.
foreach(Control ctrl in ButtonList)
{
if(ctrl is Button)
{
Button myButton = (Button)ctrl;
//Do work
}
else if(ctrl is LinkButton)
{
LinkButton myLinkButton = (LinkButton)ctrl;
//Do work
}
}
Ask others first since I am way over due for sleep, and good night. That 'should' work though.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
LinkButton, Button and ImageButton dont have a shared base class, but they do have an interface which they all implement called IButtonControl . So this will work for you (asuming that IButtonControl has the property/method you are trying to use)
foreach(IButtonControl btn in ButtonList
{
...
}
|
|
|
|
|
hai sir/mam
how to merge two individual picture into a single picture box
and back image is remain constant but the fore imageis transparent and to visible two picture givean example code also
ok bye sir/mam
|
|
|
|