Issue with using OpenSlide - c#

I am new to C# and can't get OpenSlide to work. I need it to be able to read SVS files. Below is the code I have used. Is it possible I am missing something in a directory? My boss has used the same code and can get it to run without issue.
I am getting the following error:
OpenSlideNET.OpenSlideUnsupportedFormatException: 'Exception of type 'OpenSlideNET.OpenSlideUnsupportedFormatException' was thrown.'
using OpenSlideNET;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SVSCurrent1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenSlideImage image = OpenSlideImage.Open("‪C:\\projects\\SVS\\JP2K-33003-1.svs");
}
}
}

Related

Button doesn't work, no issues are found, did I write something wrong?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Speech.Recognition;
namespace tofuchanfra
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer();
wplayer.URL = #"C:\Users\Cristi\Music\DOOM CROSSING Eternal HorizonsMusic Video feat. Natalia Natchan.mp3";
wplayer.controls.play();
}
}
}
I am trying to make a Winforms program that plays an audio file, there is no error when debugging but when I fire it up and press the button, nothing plays.
I have tried to make another button and use that one but it still doesn't work, any help?

C# ReadallLines display in ListBox Not Working

I am new to C# and have been trying for hours to accomplish this simple task of reading a file into an array and displaying in a listbox. However, it never seems to read the file and the listbox is blank and I don't get any errors. What am I missing?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace WorldSersisChamps
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
string[] lines = System.IO.File.ReadAllLines(#"C:\Users\jsommer\Documents\Classes\WorldSersisChamps\WorldSersisChamps\bin\Debug\Sales.txt");
foreach (string line in lines)
{
lbTeams.Items.AddRange(lines);
}
}
}
}

C# Trying to find the RobloxPlayerBeta

Here is my code: I am trying to find the roblox PlayerBeta but its not working
I am not the best in coding but I found out how to find it but cant implent it right into the code
( EDIT ) The program works if I use the PID but that changes everytime I open up a new RobloxPlayerBeta ! so I cannot use that
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Memory;
using System.Diagnostics;
namespace ForceField
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Mem MemLib = new Mem();
private void button1_Click(object sender, EventArgs e)
{
if (System.Diagnostics.Process.GetProcesses().Any((p) => p.ProcessName.Contains("RobloxPlayerBeta")))
{
int robloxPid = System.Diagnostics.Process.GetProcessesByName("RobloxPlayerBeta").FirstOrDefault().Id;
}
Console.WriteLine(robloxPid);
MemLib.writeMemory("0x184C3A98", "string", "PlsNoBan ");
Console.WriteLine(MemLib.readString("0x184C3A98"));
}
}
}
Omg I am stupid.. xD
I needed to do MemLib.OpenGameProcess(robloxPid)

access selected item from another from

I have two forms: one has a listbox with a list<>. I need to access the selected item of this textbox on a second form.
First form(GestaoJogadores_Admin):
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class GestaoJogadores_Admin : Form
{
private DiagramaEntidadesContainer dbATMT;
public GestaoJogadores_Admin()
{
InitializeComponent();
dbATMT = new DiagramaEntidadesContainer();
RefreshListaJogadores();
}
private void button_editarGestaoJogadores_Click(object sender, EventArgs e)
{
EditarJogador_Admin EditarJogadorAdmin = new EditarJogador_Admin();
Player jogadorSelecionado = (Player)lb_Jogadores.SelectedItem;
DialogResult resultado = EditarJogadorAdmin.ShowDialog();
}
}
}
Second form(EditarJogador_Admin)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class EditarJogador_Admin: Form
{
private DiagramaEntidadesContainer dbATMT;
public EditarJogador_Admin()
{
InitializeComponent();
dbATMT = new DiagramaEntidadesContainer();
}
private void button_EditarJogadorOk_Click_1(object sender, EventArgs e)
{
GestaoJogadores_Admin GestaoJogadoresAdmin = new GestaoJogadores_Admin();
Player jogadorSelecionado = (Player)GestaoJogadoresAdmin.jogadorSelecionado;//this is what I need, but it doenst work. I get an errror: 'GestaoJogadores_Admin' does not contain a definition for 'jogadorSelecionado' and no extension method 'jogadorSelecionado' accepting a first argument of type 'GestaoJogadores_Admin' could be found (are you missing a using directive or an assembly reference?)`
}
}
}
I open my second form creating an instance of it on the first one and using ShowDialog. On the second on, I thought that if I did the same and tried to access the "jogadorSelecionado" inside of it, It would work, but It doesnt...
In your first form on the button change
Player jogadorSelecionado = (Player)lb_Jogadores.SelectedItem;
try
EditarJogadorAdmin.passFromFormOne = (Player)lb_Jogadores.SelectedItem;
And on your second form add the variable to pass it too.
public Player passFromFormOne;
then
Player jogadorSelecionado = passFromFormOne;

Cannot bind to the property or column Ap_time on the DataSource

I tried dragging a data source object from my Patients table into the form by expanding patients, going to appointments (it is there because it is connected with a foreign key) and dragging the appointment time onto the form.
When I run the program, I get "Cannot bind to the property or column Ap_time on the DataSource."
I am at a loss and am stressing out over this.
Heres my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Validation;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class PatientMaster : Form
{
public PatientMaster()
{
InitializeComponent();
}
ClassLibrary3.HospitalEntities dbcontext = new ClassLibrary3.HospitalEntities();
private void PatientMaster_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
dbcontext.Patients.OrderBy(patient => patient.Pat_Last_Name).ThenBy(patient => patient.Pat_First_Name).Load();
patientBindingSource.DataSource = dbcontext.Patients.Local;
}
}
}
I think you are missing ToBindingList():
patientBindingSource.DataSource = dbcontext.Patients.Local.ToBindingList();

Categories

Resources