|
|
I have a written a component that solves Word Up boards (a word game of sorts). This component is used via a Web Service interface by Websites for graphical display of these solutions. It was all working fine until I tried to refactor some of the code into a base assembly (another DLL). Now, even though both of these assemblies are referenced and deployed with the Web Service application, only the latter assembly appears to be picked up.
To summarise... Web Service deployed with Two DLLs (a hierarchy) only appears to load the second of the two and hence none of the base types are available at runtime (no errors, no exceptions, just a crash!). I dont really want to have to try and dynamically load the assembly via Assembly.Load as the solution works fine apart from when it is deployed behind a Web Service.
Any ideas guys?
Thanks,
Alex.
|
|
|
|
|
Hello,
I am trying to cobble together some C# code to make my powershell scripts launch from buttons on a menu. I seem to be running into about 6 or 8 syntax errors. I don't know C#
very well yet, so I have a hard time finding these kinds of issues. Here is my code, if someone would be so kind to look it over...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Management.Automation;
using System.Collections.ObjectModel;
using System.Management.Automation.Runspaces;
/// Class that assists in asynchronously executing and retrieving the results of a powershell script pipeline.
public class PipelineExecutor
{
/// Gets the powershell Pipeline associated with this PipelineExecutor
public Pipeline Pipeline
{
get;
}
public delegate void DataReadyDelegate(PipelineExecutor sender, ICollection data);
public delegate void DataEndDelegate(PipelineExecutor sender);
/// Occurs when there is new data available from the powershell script.
public event DataReadyDelegate OnDataReady;
/// Occurs when powershell script completed its execution.
public event DataEndDelegate OnDataEnd;
/// Constructor, creates a new PipelineExecutor for the given powershell script.
public PipelineExecutor(Runspace runSpace, ISynchronizeInvoke invoker, string command);
/// Start executing the script in the background.
public void Start();
/// Stop executing the script.
public void Stop();
}
namespace ScriptLauncher
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
private string RunScript(string scriptText)
{
// create Powershell runspace
Runspace runspace = RunspaceFactory.CreateRunspace();
// open it
runspace.Open();
// create a pipeline and feed it the script text
Pipeline pipeline = runspace.CreatePipeline();
pipeline.Commands.AddScript(scriptText);
// add an extra command to transform the script output objects into nicely formatted strings
// remove this line to get the actual objects that the script returns. For example, the script
// "Get-Process" returns a collection of System.Diagnostics.Process instances.
pipeline.Commands.Add("Out-String");
// execute the script
Collection results = pipeline.Invoke();
// close the runspace
runspace.Close();
// convert the script result into a single string
StringBuilder stringBuilder = new StringBuilder();
foreach (PSObject obj in results)
{
stringBuilder.AppendLine(obj.ToString());
}
return stringBuilder.ToString();
}
MessageBox.Show(
private void button4_Click(object sender, EventArgs e)
{
"I'm so happy", "Whoopee!!!");
}
}
}
}
|
|
|
|
|
Im trying to access a certan column in a data bound DataGridView like this.
int index = (int)dataGridView1.Columns["SomeColumn"].DisplayIndex;
But some how i allways got the "dataGridView1.Columns["SomeColumn"]" to be null. That is it is not set to an object. But if i use the syntax
int index = (int)dataGridView1.Columns[0].DisplayIndex it works fine!
Any ideas? Ive got nothing
Thankz
|
|
|
|
|
dataGridView1.Columns[0].Name
|
|
|
|
|
Yes but isnt it possible to access both like Columns[integer] and Columns[String]?
Then i dont have to know the actual index for the column i seek. Thats the beauti
|
|
|
|
|
See, I know that Columns[string] works so without further evidence I am forced to assume that you are not using a valid string value. My post was suggesting that you look at the Name properties of all the columns to find your error. Apparently my short post was not enough to steer you in that direction.
|
|
|
|
|
Oh man! You where right, what a god damn rockie misstake
In the database the columns name i CustomerID so naturaly i tryed that. But the true name was customerIDDataGridViewTextBoxColumn
Thanks for the help!
|
|
|
|
|
hi,
I have a textbox. how can i avoid that a user types strings in it, bud only decimal values?
thanx
|
|
|
|
|
Djavid j wrote: I have a textbox. how can i avoid that a user types strings in it, bud only decimal values?
MaskedTextBox could be used, or you could handle the Key events (KeyDown, KeyPress, KeyUp) and look at what was typed there, only allowing characters that pass your criteria through.
There may be other ways.
Good Luck!
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
Or use a NumericUpDown instead.
|
|
|
|
|
|
I think it is pretty easy to prevent user from entering any text value, we may use following lines of code in KeyPress event of Text box–
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (Char.IsLetter (e.KeyChar))
e.Handled = true;
}
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Is anyone of you familiar with Anti-Grain Geometry? I just stumbled across it this week and would love to use it in my program but I can't figure out HOW to use it!
I am trying to use the C# wrapper created by the guys at CreativeDocs.Net --> http://www.creativedocs.net/
Just so you know, I have exhuasted google trying to find some kind of documentation.
Any pointers would be greatly appreciated!
Richard
may your code be error free.
(okay, maybe two lines.)
|
|
|
|
|
Ohh!! You've found one of those "figure it out on your own" libraries.
Never heard of it. Never used it. My first source of information would be the people who wrote it, which appears to be Epsitec SA[^].
|
|
|
|
|
how would i get me Visual C# to load a image i have loaded to a resource files in this script:
///
/// Load your graphics content. If loadAllContent is true, you should
/// load content from both ResourceManagementMode pools. Otherwise, just
/// load ResourceManagementMode.Manual content.
///
/// <param name="loadAllContent" />Which type of content to load.
protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{
load(Resource1.logo);
}
// TODO: Load any ResourceManagementMode.Manual content
}
private void load(object logo)
{
throw new Exception("Help i don't know what i'm doing!!!");
}
I have tried a hundred differnt ways and i keep gettign errors. Plz Help if you can
Michael
(Up and coming Game programmer)
EST
|
|
|
|
|
Please give your messages more meaningful titles.
__________________________
Don't drink and derive.
Alcohol and calculus don't mix.
|
|
|
|
|
MMaines2005 wrote: how would i get me Visual C# to load a image i have loaded to a resource files in this script:
If I wanted to, say, load an image from a resource and display it in my PictureBox, I might do this:
myPictureBox.Image = Properties.Resources.myImageToDisplay;
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
Are you using XNA? If so, here is a handy site you might like to refer to:
http://www.xnatutorial.com/[^]
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
hi everyone,
I have a combobox wit time values like 00:00:00, 01:00:00 in it...i want to save this values in the sql server database table, when the cliks on save time...the field in the table is from DateTime Type...the problem is that there wil save also a date value in the table, like this: 1/1/1900 1:00:00 AM ...how can i save only the time from my combobox: 01:00:00, without the date value?
thanx
|
|
|
|
|
Don't save it to a datetime field. However, does the date part really matter? If you are only interested in the time part, this is easily obtained from the DateTime and you can ignore the date part.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Or save it as an integer:
1) Number of seconds after midnight
2) 12:34:56 saved as integer 123456
|
|
|
|
|
|
Hi!
I want to execute some code when I click a picturebox, but I don't know how, and I can't find an answer anywhere. So could some kind person out there take some time to teach me?
Thx Dan
|
|
|
|
|
Handle the click event of the picture box
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|