Click here to Skip to main content
15,907,396 members
Home / Discussions / C#
   

C#

 
GeneralRe: copy paste file remotly Pin
Member 79659464-Apr-18 21:03
Member 79659464-Apr-18 21:03 
GeneralRe: copy paste file remotly Pin
Eddy Vluggen4-Apr-18 23:48
professionalEddy Vluggen4-Apr-18 23:48 
GeneralRe: copy paste file remotly Pin
Member 79659467-Apr-18 19:39
Member 79659467-Apr-18 19:39 
AnswerRe: copy paste file remotly Pin
Member 79659467-Apr-18 19:40
Member 79659467-Apr-18 19:40 
GeneralRe: copy paste file remotly Pin
Eddy Vluggen8-Apr-18 0:19
professionalEddy Vluggen8-Apr-18 0:19 
QuestionOCR project Pin
Member 130706852-Apr-18 7:40
Member 130706852-Apr-18 7:40 
AnswerRe: OCR project Pin
Pete O'Hanlon2-Apr-18 7:45
mvePete O'Hanlon2-Apr-18 7:45 
QuestionWorking on OCR as my final year project. Pin
Member 130706852-Apr-18 7:17
Member 130706852-Apr-18 7:17 
AnswerRe: Working on OCR as my final year project. Pin
Dave Kreskowiak2-Apr-18 8:41
mveDave Kreskowiak2-Apr-18 8:41 
AnswerRe: Working on OCR as my final year project. Pin
User 41802543-Apr-18 14:22
User 41802543-Apr-18 14:22 
QuestionOCR project Pin
Member 130706852-Apr-18 7:13
Member 130706852-Apr-18 7:13 
AnswerRe: OCR project Pin
Dave Kreskowiak2-Apr-18 8:39
mveDave Kreskowiak2-Apr-18 8:39 
QuestionGenerate unique number from C# string Pin
MiteshUmta2-Apr-18 2:37
MiteshUmta2-Apr-18 2:37 
AnswerRe: Generate unique number from C# string Pin
Dave Kreskowiak2-Apr-18 2:53
mveDave Kreskowiak2-Apr-18 2:53 
AnswerRe: Generate unique number from C# string Pin
#realJSOP2-Apr-18 22:09
professional#realJSOP2-Apr-18 22:09 
AnswerRe: Generate unique number from C# string Pin
BillWoodruff2-Apr-18 23:41
professionalBillWoodruff2-Apr-18 23:41 
GeneralRe: Generate unique number from C# string Pin
MiteshUmta3-Apr-18 5:16
MiteshUmta3-Apr-18 5:16 
GeneralRe: Generate unique number from C# string Pin
BillWoodruff3-Apr-18 7:46
professionalBillWoodruff3-Apr-18 7:46 
AnswerRe: Generate unique number from C# string Pin
MadMyche4-Apr-18 5:16
professionalMadMyche4-Apr-18 5:16 
SuggestionRe: Generate unique number from C# string Pin
Richard Deeming4-Apr-18 7:30
mveRichard Deeming4-Apr-18 7:30 
AnswerRe: Generate unique number from C# string Pin
Pete O'Hanlon4-Apr-18 8:45
mvePete O'Hanlon4-Apr-18 8:45 
AnswerRe: Generate unique number from C# string Pin
BillWoodruff4-Apr-18 14:00
professionalBillWoodruff4-Apr-18 14:00 
Absent the OP responding: let's throw some more ideas against the wall Smile | :)
C#
// requires your project has a reference to System.Numerics, and a using statement foe it

Guid g = Guid.NewGuid();
byte[] b = g.ToByteArray();
BigInteger bigI = new BigInteger(b);

string s0 = g.ToString();
string s1 = System.Text.Encoding.Unicode.GetString(b);
string s2 = System.Text.Encoding.UTF8.GetString(b);
string s3 = System.Text.Encoding.ASCII.GetString(b);
string s4 = bigI.ToString();

Console.WriteLine($"guid to string: {s0}\r\nbyte[] to Unicode string: {s1}\r\nbyte[] to UTF8 string: {s2}\r\nbyte[] to ASCII string: {s3}\r\nbyte[] to BigInt to string: {s4}");
Sample output:

guid to string: 80e05ce5-8fb1-43d3-9c6a-ef1f69d1c07b
byte[] to Unicode string: ????????
byte[] to UTF8 string: ?\????C?j?i??{
byte[] to ASCII string: ?\?????C?j?i??{
byte[] to BigInt to string: 164496211830831038497496437204793187557

Note that converting a GUID to a Byte[] involves an ordering of the bytes many find non-intuitive: [^]
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12

QuestionSerialPort.ReadLine() ? Pin
ibrahimayhans2-Apr-18 2:11
ibrahimayhans2-Apr-18 2:11 
AnswerRe: SerialPort.ReadLine() ? Pin
Gerry Schmitz2-Apr-18 6:49
mveGerry Schmitz2-Apr-18 6:49 
Questiondesigning around the need for an abstract static method Pin
Alexander Kindel1-Apr-18 15:21
Alexander Kindel1-Apr-18 15:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.