Click here to Skip to main content
15,890,123 members
Home / Discussions / C#
   

C#

 
GeneralRe: Matching Percent Symbol Using REGEX Pin
jschell1-Dec-17 7:48
jschell1-Dec-17 7:48 
QuestionHow To Make This Async [UPDATED] Pin
Kevin Marois29-Nov-17 6:03
professionalKevin Marois29-Nov-17 6:03 
AnswerRe: How To Make This Async [UPDATED] Pin
Dave Kreskowiak29-Nov-17 14:42
mveDave Kreskowiak29-Nov-17 14:42 
GeneralRe: How To Make This Async [UPDATED] Pin
Kevin Marois30-Nov-17 4:19
professionalKevin Marois30-Nov-17 4:19 
AnswerRe: How To Make This Async [UPDATED] Pin
Member 1351776130-Nov-17 2:36
Member 1351776130-Nov-17 2:36 
GeneralRe: How To Make This Async [UPDATED] Pin
Dave Kreskowiak30-Nov-17 4:31
mveDave Kreskowiak30-Nov-17 4:31 
GeneralRe: How To Make This Async [UPDATED] Pin
Alex Schunk8-Jan-18 8:04
Alex Schunk8-Jan-18 8:04 
GeneralRe: How To Make This Async [UPDATED] Pin
Alex Schunk8-Jan-18 8:01
Alex Schunk8-Jan-18 8:01 
QuestionSimple Injector and Strategy pattern (Register dependency runtime based on request) Pin
nikunjmochi29-Nov-17 2:02
nikunjmochi29-Nov-17 2:02 
AnswerRe: Simple Injector and Strategy pattern (Register dependency runtime based on request) Pin
Eddy Vluggen29-Nov-17 2:26
professionalEddy Vluggen29-Nov-17 2:26 
GeneralRe: Simple Injector and Strategy pattern (Register dependency runtime based on request) Pin
nikunjmochi29-Nov-17 2:34
nikunjmochi29-Nov-17 2:34 
GeneralRe: Simple Injector and Strategy pattern (Register dependency runtime based on request) Pin
Eddy Vluggen29-Nov-17 2:52
professionalEddy Vluggen29-Nov-17 2:52 
QuestionUsing Reflection Pin
Mycroft Holmes28-Nov-17 14:21
professionalMycroft Holmes28-Nov-17 14:21 
GeneralRe: Using Reflection Pin
PIEBALDconsult28-Nov-17 14:30
mvePIEBALDconsult28-Nov-17 14:30 
AnswerRe: Using Reflection Pin
User 740747028-Nov-17 16:28
User 740747028-Nov-17 16:28 
GeneralRe: Using Reflection Pin
Mycroft Holmes28-Nov-17 23:02
professionalMycroft Holmes28-Nov-17 23:02 
GeneralRe: Using Reflection Pin
User 740747028-Nov-17 23:37
User 740747028-Nov-17 23:37 
AnswerRe: Using Reflection Pin
BillWoodruff30-Nov-17 0:35
professionalBillWoodruff30-Nov-17 0:35 
GeneralRe: Using Reflection Pin
Mycroft Holmes30-Nov-17 12:01
professionalMycroft Holmes30-Nov-17 12:01 
GeneralRe: Using Reflection Pin
BillWoodruff30-Nov-17 21:48
professionalBillWoodruff30-Nov-17 21:48 
QuestionI am trying to create and write to a file using one boolean bit at a time. Pin
computerpublic28-Nov-17 13:17
computerpublic28-Nov-17 13:17 
C#
// I AM TRYING TO WRITE AND CREATE A FILE, USING ONLY ONE BIT AT A TIME.
// I AM WRITING THE FILE, BUT NOTHING GOES IN.
// ALSO I GETTING ERRORS FOR BEING OUTSIDE OF THE ARRAY.
using System;
using System.IO;
using System.Collections;
namespace Applica
{
    static class Program
    {
        static void Main(string[] args)
        {
            bool tif = true;
            byte[] buffer = BitConverter.GetBytes(tif);
            FileInfo ap = new FileInfo("tempii.txt");
            string filePath = ap.FullName;
            string destinationPath = Path.Combine("C:\\check", Path.GetFileName(filePath));
            using (Stream output = File.OpenWrite(destinationPath))
            {
                int bits = 32;
                while (bits > 0)
                {
                    for (int i = 1; i < 33; i++)//4 random bytes
                    {
                        if (tif == true)
                        {
                            tif = false;
                            goto A;
                        }
                        if (tif == false) tif = true;
                        A:;
                        output.Write(buffer, 0, bits);
                    }
                }
            }
        }
    }
}


modified 28-Nov-17 20:21pm.

GeneralRe: I am trying to create and write to a file using one boolean bit at a time. Pin
PIEBALDconsult28-Nov-17 14:21
mvePIEBALDconsult28-Nov-17 14:21 
AnswerRe: I am trying to create and write to a file using one boolean bit at a time. Pin
Sascha Lefèvre28-Nov-17 14:52
professionalSascha Lefèvre28-Nov-17 14:52 
AnswerRe: I am trying to create and write to a file using one boolean bit at a time. Pin
Gerry Schmitz29-Nov-17 4:59
mveGerry Schmitz29-Nov-17 4:59 
AnswerRe: I am trying to create and write to a file using one boolean bit at a time. Pin
________________2-Dec-17 23:37
________________2-Dec-17 23:37 

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.