Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

need help with the output code C#?

what is the output for this code ?
string str2 = Conversions.ToString(123) + "\x0001\x001e" + Conversions.ToString(Strings.Chr(246)) + "\x0003\r$\x0003\n" + Conversions.ToString(Strings.Chr(227)) + "\r" + Conversions.ToString(Strings.Chr(244)) + "%" + Conversions.ToString(Strings.Chr(230)) + "\x001e5";

what is the value of var str2?
str2=????
You can solve this yourself, here are the steps:
1. Create a new console app in visualStudio in C#(Dont forget to add a reference to Microsoft.VisualBasic)
2. Copy and paste that code you provided into the console app and simply print the result.

For example,
string str2 = string str2 = Conversions.ToString(123) + "\x0001\x001e" + Conversions.ToString(Strings.Chr(246)) + "\x0003\r$\x0003\n" + Conversions.ToString(Strings.Chr(227)) + "\r" + Conversions.ToString(Strings.Chr(244)) + "%" + Conversions.ToString(Strings.Chr(230)) + "\x001e5";
Console.WriteLine(str2);

or if you want to write it to a file do whatever you want with it like File.WriteAllText(output.txt, str2);
(Jul 18, 2020 07:23 PM)VENI Wrote:  You can solve this yourself, here are the steps:
1. Create a new console app in visualStudio in C#(Dont forget to add a reference to Microsoft.VisualBasic)
2. Copy and paste that code you provided into the console app and simply print the result.

For example,
string str2 = string str2 = Conversions.ToString(123) + "\x0001\x001e" + Conversions.ToString(Strings.Chr(246)) + "\x0003\r$\x0003\n" + Conversions.ToString(Strings.Chr(227)) + "\r" + Conversions.ToString(Strings.Chr(244)) + "%" + Conversions.ToString(Strings.Chr(230)) + "\x001e5";
Console.WriteLine(str2);

or if you want to write it to a file do whatever you want with it like File.WriteAllText(output.txt, str2);

Use linqpad instead of creating new console projects every time you want to run short snippets/test code.
(Jul 18, 2020 09:04 PM)iolaka Wrote:  Use linqpad instead of creating new console projects every time you want to run short snippets/test code.

This should be easier to use https://dotnetfiddle.net/
123ö
$
ã
ô%æ5

it is your output!!
(Jul 18, 2020 09:04 PM)iolaka Wrote:  Use linqpad instead of creating new console projects every time you want to run short snippets/test code.

Yes... it's really good...
BTC - bc1q3efew3yzfwhdz290dafykaw0a2w56g2j69g2c6
ETH - 0xf1c873217032468990D3313da6509D1b813c4671
USDT - 0xf1c873217032468990D3313da6509D1b813c4671
PP - [email protected]
thank you for every one replies ......

But when i execute the code in C# it gives me Error ?


(Jul 18, 2020 07:23 PM)VENI Wrote:  You can solve this yourself, here are the steps:
1. Create a new console app in visualStudio in C#(Dont forget to add a reference to Microsoft.VisualBasic)
2. Copy and paste that code you provided into the console app and simply print the result.

For example,
string str2 = string str2 = Conversions.ToString(123) + "\x0001\x001e" + Conversions.ToString(Strings.Chr(246)) + "\x0003\r$\x0003\n" + Conversions.ToString(Strings.Chr(227)) + "\r" + Conversions.ToString(Strings.Chr(244)) + "%" + Conversions.ToString(Strings.Chr(230)) + "\x001e5";
Console.WriteLine(str2);

or if you want to write it to a file do whatever you want with it like File.WriteAllText(output.txt, str2);
this is the full code i need to know to know the password ?
public static string getconnection(string path, typeconn type)
{
string str;
try
{
switch (type)
{
case typeconn.acc2007:
return ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\"" + path.ToString() + "\";Jet OLEDB:Database Password=123123");

case typeconn.acc2003:
{
string str2 = Conversions.ToString(0x7b) + "\x0001\x001e" + Conversions.ToString(Strings.Chr(0xf6)) + "\x0003\r$\x0003\n" + Conversions.ToString(Strings.Chr(0xe3)) + "\r" + Conversions.ToString(Strings.Chr(0xf4)) + "%" + Conversions.ToString(Strings.Chr(230)) + "\x001e5";
return ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"" + path.ToString() + "\";Persist Security Info=True;Jet OLEDB:Database Password='" + str2 + "';");
}
}
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
str = Conversions.ToString(false);
ProjectData.ClearProjectError();
}
return str;
}


(Jul 18, 2020 09:11 PM)VENI Wrote:  This should be easier to use https://dotnetfiddle.net/
Look to the full code
I need to open 2003.mdb database

public static string getconnection(string path, typeconn type)
{
string str;
try
{
switch (type)
{
case typeconn.acc2007:
return ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\"" + path.ToString() + "\";Jet OLEDB:Database Password=123123");

case typeconn.acc2003:
{
string str2 = Conversions.ToString(0x7b) + "\x0001\x001e" + Conversions.ToString(Strings.Chr(0xf6)) + "\x0003\r$\x0003\n" + Conversions.ToString(Strings.Chr(0xe3)) + "\r" + Conversions.ToString(Strings.Chr(0xf4)) + "%" + Conversions.ToString(Strings.Chr(230)) + "\x001e5";
return ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"" + path.ToString() + "\";Persist Security Info=True;Jet OLEDB:Database Password='" + str2 + "';");
}
}
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
str = Conversions.ToString(false);
ProjectData.ClearProjectError();
}
return str;
}
Seemingly the string contains characters that are not readable by humans such as SOH, line feed and carriage return.

I would programmatically put it in your clipboard so that you don't mess up. Especially since some IDEs might convert linefeed or carriage return to a combination of both. There might also be other conversion by the IDE.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by SIM-2362662May 9, 2018 10:30 PM 4 231 May 9, 2018 10:30 PM
Last Post: 0xDEAD10CC
[Java] by VigilFeb 8, 2018 10:22 AM 9 180 Feb 8, 2018 10:22 AM
Last Post: Vigil
[C] by kakarot007Nov 6, 2017 08:31 PM 6 232 Nov 6, 2017 08:31 PM
Last Post: HiddenEyE