我一直在研究用c#绘制图表的方法.我有一个特定的要求,绘制一个图表,其中包含y轴和x轴以及第二个y轴.我已经尝试过使用excel Interop但是没有找到解决方案.我已经开始使用MSChart组件但是没有达到任何数据我的数据与...合作
index lines branches
1 20 5
2 30 8
3 34 6
Run Code Online (Sandbox Code Playgroud)
我想在x轴上绘制索引,在左y轴上绘制线的比例,在右y轴上绘制分支的比例.
我正在使用.net版本2.0和3.5,如果这有帮助
嗨,我正在创建一个Windows服务来查看某些目录,以查看目录的大小是否达到其限制.我创建了一个文件系统观察器如下
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = dirPaths[i].ToString();
watcher.NotifyFilter = NotifyFilters.Size;
watcher.EnableRaisingEvents = true;
watcher.Changed += new FileSystemEventHandler(OnChanged);
Run Code Online (Sandbox Code Playgroud)
和
private void OnChanged(object source, FileSystemEventArgs e)
{
try
{
string directory = new DirectoryInfo(e.FullPath).Parent.FullName;//gettting the directory path from the full path
float dirSize = CalculateFolderSize(directory);
float limitSize = int.Parse(_config.TargetSize);//getting the limit size
if (dirSize > limitSize)
{
eventLogCheck.WriteEntry("the folloing path has crossed the limit " + directory);
//TODO: mail sending
}
}
catch (Exception ex)
{
eventLogCheck.WriteEntry(ex.ToString());
}
}
Run Code Online (Sandbox Code Playgroud)
CalculateFolderSize检查驱动器中所有文件和子目录的大小. …