|
Dear friend:
which one can tell me how can I find a tool for transfer vb.net code to C# code ,or c++ to C#?
|
|
|
|
|
VB.NET to C#, tools abound. C++->C# is a lot tricker.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
As Christian said, there are many tools for converting VB to C#.
For C++ to C#, we produce the (plainly named) "C++ to C# Converter".
It is primarily a syntax converter, so it will not convert most C++ library method calls to .NET equivalents.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to C++/CLI Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
I'm looking for any code that provides a base
for exploring either bioinformatics algorithms
or Blast database lookups, etc. Anything.
Anyone have any idea how to find this?
|
|
|
|
|
mg1234 wrote: Anyone have any idea how to find this?
Google searches and maybe look around at IEEE. That's just a start.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: Google searches and maybe look around at IEEE. That's just a start.
Thanks, Paul, but I didn't find much via Google. Hence
the question.
What did you mean by looking around at IEEE? Not sure
I follow.
|
|
|
|
|
|
You need to store the current time in the session, run a client side timer, and fail the test if the server side time has ellapsed ( people can hack your client side code )
This belongs in the ASP.NET forum
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
gubba wrote: I have solved the problem using the cookies.
People can still hack that. I'd test it a bit to make sure.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I am writing an application to synchronise two MDB files, one accessed through a webserver and the other on the local system.
All well on the webserver side, but on the local system where the application is running I need to be able to change the source of the data from information in an INI file. (i.e if the MDB file is moved I need to change the source to match).
Standard OLEDbConnections to password protected MDB files seem to problematical, so I ended up using the Dataset as this saves a lot of hand coding
If you want to see a picture please feel free to look at the image here which should give you the context.
I can not figure out how to make the source of the Dataset change from within the code.
Thanks for your help
|
|
|
|
|
Hi,
I am reading the C# cookbook and came across the "encoding binary data as base64" section. They don't explain how it works so I have a question I hope I can get cleared up.
Here is the snippet:
<br />
public string Base64EncodeBytes(byte[] inputBytes)<br />
{<br />
long arrayLength = (long)(4.0d * inputBytes.Length / 3.0d);<br />
if((arrayLength % 4) != 0)<br />
{<br />
arrayLength += 4 - (arrayLength % 4);<br />
}<br />
<br />
char[] theEncodedCharArray = new char[arrayLength];<br />
Convert.ToBase64CharArray(inputBytes, 0, inputBytes.Length, theEncodedCharArray, 0);<br />
<br />
return (new string(theEncodedCharArray));<br />
}<br />
long arrayLength = (long)(4.0d * inputBytes.Length / 3.0d);
they say that the above line is needed to change each 3 byte sequence into a 4 byte sequence.
why does it have to be converted? I thought that when converting to base64 you use 3 bytes at a time.
thanks
|
|
|
|
|
namespace Authors
{
public partial class frmEditor : Form
{
string[] ArticlesTypes;
OleDbConnection dbArticles = new OleDbConnection();
public frmEditor(string[] ArticleToUse)
{
ArticlesTypes = ArticleToUse;
dbProfiles.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = G:\\CSharp\\Profiles.mdb;Jet OLEDB:Database Password=password;Persist Security Info=False";
InitializeComponent();
}
string ArticlesTypesInUse = "";
bool isUpdate = false;
private void frmEditor_Load(object sender, EventArgs e)
{
if (ArticlesTypes[0] == "ArticleID")
{
try
{
isUpdate = true;
OleDbCommand cmd = new OleDbCommand("select type_id from proArticles where profile_id= " + ArticlesTypes[1], dbArticles);
if (dbArticles.State == ConnectionState.Closed)
dbArticles.Open();
string[] sep = new string[1];
sep[0] = ",";
string[] ptu = cmd.ExecuteScalar().ToString().Split(sep,StringSplitOptions.RemoveEmptyEntries); //I am getting an error here saying "Object Reference not set to an instance of an object". Dont know how to correct this problem. Looks like there is something wrong with the connection.
for (int i = 0;i < ptu.Length; i++)
what should I do if database connection is give me a null error??
|
|
|
|
|
My first guess would be to Open() dbArticles before you instantiate the "cmd" object. You're creating it and assigning it to the connection before the connection is active.
|
|
|
|
|
Ok...like you said I did it this way:
if (dbArticles.State == ConnectionState.Closed)
dbArticles.Open();
OleDbCommand cmd = new OleDbCommand("select type_id from proArticles where _id= " + ArticlesTypes[1], dbArticles);
but it still does not work!
|
|
|
|
|
The order you associate the connection with your command makes no difference whatsoever. Association wise, it doesn't matter whether or not you open the connection and then create the command or create the command then open the connection. Although you should always attempt to open the connection just before you execute your command (preferably in the statement before) because you want the connection to be open as short a time as possible.
What I would suggest you do is break the split command apart from the ExecuteScalar part. In other words, read the value into a string - and then, if the string isn't null attempt the split. Combining operations like this can lead you into a lot of bother.
One more thing - try using a parameterised query rather than a concatenated query. It reduces the risk of you falling prey to a SQL Injection attack. Clickety[^]
|
|
|
|
|
Run the project and debug this method. Set the breakpoint on the string[] ptu line of code and when you hit the breakpoint, check the state of the connection to see if it's open or not. Also, try putting some exception handling round this line to see what exception is really being thrown. Don't guess at what the error is, do some debugging for yourself.
|
|
|
|
|
I am looking for a c# programmer to help me with improving a project. I have done the programming my self (pretty well commented and easy to understand). It is working ok but I need help from an expert to improve and clean up the programming i also want to make an installer. Ofcource you get paid and you can work from anywhere in the world.
The project is developed in c# express 2005, SQL, Source Grid, and php (I manage the php my self)
Best Regards
Andreas
Contact: programmerATbrollopDOTinfo
|
|
|
|
|
You should put this in the job forum, Job Board[^]
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi all,
I have this:
Byte[] buff = new Byte[256];
Does it exist any function which can clear whole buffer or I have to write my own code?
Thanks.
daavena
|
|
|
|
|
in .net arrays are automatically initialized to zero by the compiler. Unlike C++, no manual action is necessary.
--
Join the Campaign to Help Stamp Out and Abolish Redundancy
The preceding is courtesy of the Bureau of Unnecessarily Redundant Repetition Department.
|
|
|
|
|
Thanks for response.
I use:
NetworkStream stream = tcp.GetStream();
stream.Read(buff, 0,buff.Length);
.....
somewhere in the code again:
stream.Read(buff, 0,buff.Length);
Do I have to clear buff?
Thanks.
daavena
|
|
|
|
|
Yes and no. When you call the Read() function, it overwrites the existing array with the new data. The trick is, if there's not enough data to fill it, it does not clear the rest.
The trick is, the Read() function will RETURN to you the actual number of bytes it put in the buffer. So when you're processing the results, only look at the first n characters (Where n is the value returned).
Of course, if you're just sending the entire buffer into another function, you'll have to manually clear the rest of the buffer (Or manually clear the whole thing first).
|
|
|
|
|
Hi Ian,
As you said, Read() function doesn't clear the buffer.
I use Read() function witch will return to me n number of bytes it put in the buffer.
I also wrote a simple function for clearing buffer.
Thanks
daavena
|
|
|
|