I'm sorry, I speak a little English.
The button3_Click is work, but the Form1_Resize it does not work.
using System;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
namespace FirstApp
{
public partial class Form1 : Form
{
private void button3_Click(object sender, EventArgs e)
{
this.Hide();
notifyIcon1.Visible = true;
}
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Hide();
notifyIcon1.Visible = true;
}
}
}
}
Why? What is the problem?
I'm beginner in C#, sorry.
Related
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");
}
}
}
With this code I can prevent a duplicate application from running the name given in the code .
But after the application is created, the name of that application (exe) can be changed and run multiple times in the same machine.
How to prevent it from running?
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 Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Text = "Demo";
int ac = System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count();
if (ac > 1)
{
MessageBox.Show("Application Already Running");
this.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello World");
}
}
}```
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)
i am new to .net i am having trouble playing videos automatically. I would be showing different textboxes here but i want the video to autplay without any buttons
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 WMPLib;
namespace ThinkQDisplay
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
{
AxWindowsMediaPlayer1.URL = "C:\Users\Ramrod\Documents\Visual Studio 2012\Projects\ThinkQDisplay\ThinkQDisplay\sample.avi";
}
}
}
It keeps telling it is an unrecognized escape sequence. Also I would like to have a separate form (form2). Where I can choose what to play here on form 1. Is it also possible to have it looped?
private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
{
axWindowsMediaPlayer1.URL = #"C:\Users\Ramrod\Documents\Visual Studio 2012\Projects\ThinkQDisplay\ThinkQDisplay\sampler.avi";
}
private void Form1_Load(object sender, EventArgs e)
{
axWindowsMediaPlayer1.settings.autoStart = true;
}
}
}
I want to make stream application for RTSP cam to open VLC
when I press the button show to me the stream in the application but it doesn't show to me anything I want the program to display the stream in VLC
this the code of the application using c#
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 vlc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void axVLCPlugin21_Enter(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.add("rtsp://192.168.0.209:554/mpeg4", "live", "network-caching=75");
//pictureBox1.Visible = false;
axVLCPlugin21.playlist.play();
}
}
}