Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6005013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:20:37+00:00 2026-05-23T01:20:37+00:00

I want to download the code from http://pastehtml.com/view/awono3xoq.txt , save it to a string,

  • 0

I want to download the code from http://pastehtml.com/view/awono3xoq.txt, save it to a string, then compile & run it when the button is clicked, but I can’t seem to get the code below to work:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
using System.IO;
using System.Diagnostics;
using System.Net;
using System.Runtime.InteropServices; 

namespace ASV
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }
    public void compile()
    {
        CSharpCodeProvider myCodeProvider = new CSharpCodeProvider();
        ICodeCompiler myCodeCompiler = myCodeProvider.CreateCompiler();
        String [] referenceAssemblies = {"System.dll"};
        string myAssemblyName = "Assembly.exe";
        CompilerParameters myCompilerParameters = new CompilerParameters(referenceAssemblies, myAssemblyName);
        myCompilerParameters.GenerateExecutable = true;
        myCompilerParameters.GenerateInMemory = true;
        WebClient x = new WebClient();
        Stream y = x.OpenRead("http://pastehtml.com/view/awono3xoq.txt");
        StreamReader z = new StreamReader(y);
        string source = z.ReadToEnd();
        z.Close();
        y.Close();
        CompilerResults compres = myCodeCompiler.CompileAssemblyFromSource(myCompilerParameters, source);
        Process.Start("Assembly.exe");
    }

    private void button1_Click(object sender, EventArgs e)
    {
        compile();
    }
}
}

what am I doing wrong (other than having too many using statments :P)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:20:38+00:00Added an answer on May 23, 2026 at 1:20 am

    If you check CompilerResults compres it shows that there’s an exception and the compilation was not successful and hence it’s not writing out Assembly.exe and there is a System.IO.FileNotFound exception from Process.Start()

    Try this

    public void compile()
    {
        CSharpCodeProvider myCodeProvider = new CSharpCodeProvider();
        ICodeCompiler myCodeCompiler = myCodeProvider.CreateCompiler();
        string myAssemblyName = @"Assembly.exe";
        CompilerParameters myCompilerParameters = new CompilerParameters
                                                      {
                                                          OutputAssembly = myAssemblyName,
                                                          GenerateExecutable = true,
                                                          GenerateInMemory = true
                                                      };
        myCompilerParameters.ReferencedAssemblies.Add("System.dll");
        WebClient x = new WebClient();
        Stream y = x.OpenRead("http://pastehtml.com/view/awono3xoq.txt");
        StreamReader z = new StreamReader(y);
        string source = z.ReadToEnd();
        z.Close();
        y.Close();
        CompilerResults compres = myCodeCompiler.CompileAssemblyFromSource(myCompilerParameters, source);
        Process.Start(myAssemblyName);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://code.google.com/intl/en/appengine/docs/python/tools/uploadingdata.html the api is : Downloading Data from App Engine To start a data
I want to get the size of an http:/.../file before I download it. The
There's this Excel file I want users to be able to download from my
Sorry for maybe this is stupid question, I just want download source code form
I want to download a file from internet and I imagine this should be
I want to download a file from Internet and InternetReadFile seem a good and
I want to download this open source application, and they are using Git. What
I want to download and parse webpage using python, but to access it I
I want to provide dynamic download of files. These files can be generated on-the-fly
I want Windows Update to automatically download and install updates on my Vista machine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.