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

  • Home
  • SEARCH
  • 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

I am using jQuery auto-complete. I have download this script from http://code.google.com/p/jquery-autocomplete/ . I
I downloaded the STL source code from http://www.sgi.com/tech/stl/download.html , but it only has the
I want to download this picture using Ruby. How do I do that? http://farm1.static.flickr.com/92/218926700_ecedc5fef7_o.jpg
http://code.google.com/intl/en/appengine/docs/python/tools/uploadingdata.html the api is : Downloading Data from App Engine To start a data
http://motionsharing.com/site/download/acefad55f1e81e456d71a7448b278915 Cannot connect to MySQl database from Eclipse DataSource Explorer. I tune appropriate driver
I am trying to use http://code.google.com/p/amazon-s3-php-class/ to force-dowload files from AWS S3. I have
I have url like: http://www.matweb.com/search/DataSheet.aspx?MatGUID=849e2916ab1541be9ff6a17b78f95c82 I want to download source code from that page
I want to download the 'pyflix' library that was previously hosted at http://svn.pyflix.python-hosting.com/trunk/ .
I want to download a .zip file which is available at URL http://www.nseindia.com/content/equities/cmbhav.htm by
I want to download and save pdf file to internal storage. Here is code

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.