Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
that code work fine on Visual Basic 2010
i used now c# 2015 and there no dim on c#?

Dim fs As New IO.FileStream("HTUserSetting.sys", FileMode.Open, FileAccess.ReadWrite)
Dim strHex As String = "012003000058020000100000000100000000000000000001"

What I have tried:

C#
<pre lang="c#"><pre lang="c#">
Posted
Updated 12-Aug-19 0:26am
Comments
F-ES Sitecore 12-Aug-19 6:15am    
Get a book on C# and go through it, or at least go through some "getting started" tutorials on the web. You can't possibly learn a new language from asking questions on a forum, and if you have to ask how to even define variables then you're going to be asking a lot of questions. Rather than wasting your time and ours, take steps to learn the basics yourself.

As F-ES Sitecore[^] mentioned, you should read some book.

There's no Dim instruction in C#! You define a variable by using its type and name:
C#
FileStream fs = new IO.FileStream("HTUserSetting.sys", FileMode.Open, FileAccess.ReadWrite);
string strHex  = "012003000058020000100000000100000000000000000001";


For further details, please see: Comparison of C Sharp and Visual Basic .NET - Wikipedia[^]
 
Share this answer
 
v3
Comments
Ahmed Adel 12-Aug-19 22:05pm    
FileStream fs = new System.IO.FileStream("HTUserSetting.sys", FileMode.Open, FileAccess.ReadWrite);
string strHex = "012003000058020000100000000100000000000000000001";

i got green line on strHex !!
this code work fine , i fix some issues
next problem HTusersetting in used problem i try to fix this issue too , really thanks bro
Maciej Los 13-Aug-19 2:48am    
You're very welcome.

If my answer was helpful, please accept it (green button).
Ahmed Adel 13-Aug-19 5:13am    
sure i will , but still can`t make hexa , hexa on ascii not on hexa location , can you help me
Maciej Los 13-Aug-19 6:06am    
What you mean by saying "hexa"? I don't get you...
Unless... you want to convert string into its hex representation:
string strvalue = "Maciej Los";
var strHex = BitConverter.ToString(Encoding.Default.GetBytes(strvalue)).Replace("-", "");
//result: 4D616369656A204C6F73
Ahmed Adel 13-Aug-19 7:04am    
i don`t have value brother , i want to write hex without value , because my game already encrypted
Quote:
that code work fine on Visual Basic 2010
i used now c# 2015 and there no dim on c#?

This is the principle: different names, different languages, different ways to do things.
The same thing is done differently on different languages.
You need to learn both languages to be able to translate between them.
You can't learn a new language by asking tens of questions in this forum, it will be more efficient if you find a tutorial to get you started.
 
Share this answer
 
 
Share this answer
 
v2
I would strongly echo the advice in the above comment, variable declaration is a pretty fundamental thing in any language and you won't get far without it!

C# declarations take the form [type] [name] (= value); in this case:

IO.FileStream fs = new IO.FileStream("HTUserSetting.sys", FileMode.Open, FileAccess.ReadWrite);
String strHex = "012003000058020000100000000100000000000000000001";
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900