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

  • SEARCH
  • Home
  • 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 6840387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:50:16+00:00 2026-05-26T23:50:16+00:00

i have a dot format file and i download graphvis for windows now how

  • 0

i have a dot format file and i download graphvis for windows now
how can i use graphvis to show a graph in my c# application?

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 VDS.RDF;
using VDS.RDF.Parsing;
using VDS.RDF.Query;
using System.IO;
using System.Windows;
using System.Runtime.InteropServices;
using VDS.RDF.Writing;
using System.Diagnostics;

namespace WindowsFormsApplication2
{
    public partial class first : Form

    {

         Graph g = new Graph();
         string s1 = null;

/**************************************DATA********************************************/
        public first()
        {
            InitializeComponent();

        }

        private void button1_Click(object sender, EventArgs e)
        {

            Stream myStream = null;

            var parser = new Notation3Parser();
            var graph = new Graph();
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.Filter = "RDF files (*.n3)|*.n3";
            openFileDialog1.FilterIndex = 1;
            openFileDialog1.RestoreDirectory = true;
            openFileDialog1.Multiselect = false;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    if ((myStream = openFileDialog1.OpenFile()) != null)
                    {
                        using (myStream)
                        {
                            string s = openFileDialog1.FileName.ToString();
                            string w= Directory.GetCurrentDirectory().ToString();
                            string Fname = openFileDialog1.SafeFileName.ToString();
                            File.Copy(s,Path.Combine(w,Fname),true);

                            // Insert code to read the stream here.
                            Win32.AllocConsole();
                            s1 = Path.Combine(w, Fname);
                            insertNodeButton.Visible = true;
                            delBut.Visible = true;
                            simi.Visible = true;
                            showNodes showNodes1 = new showNodes(s1);
                            g = showNodes1.returngraph();

                           Console.Read();
                           Win32.FreeConsole();
                          // g.SaveToFile("firstfile.n3");

                           this.Show();
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
                }
            }
            GraphVizWriter hi = new GraphVizWriter();
            hi.Save(g, "c:\\ahmad.dot");

        }

this is my code i want to visul ahmad.dot file format to show a graph with graphvis or some sipmle class to show dot file format in png format

  • 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-26T23:50:16+00:00Added an answer on May 26, 2026 at 11:50 pm

    I’ve used simple code to launch dot.exe like so in the past:

    private static string GenDiagramFile(string pathToDotFile)
    {
        var diagramFile = pathToDotFile.Replace(".dot", ".png");
    
        ExecuteCommand("dot", string.Format(@"""{0}"" -o ""{1}"" -Tpng", 
                     pathToDotFile, diagramFile));
    
        return diagramFile;
    }
    
    private static void ExecuteCommand(string command, string @params)
    {
        Process.Start(new ProcessStartInfo(command, @params) {CreateNoWindow = true, UseShellExecute = false });
    }
    

    If you don’t mind a little quick-and-dirty approach, this may work for you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .dot file and I am using command line to plot a
I can't seem to figure this out. I have a .dot file, which is
I have a legacy dot net application (now migrated to .net 2.0). We need
I'm trying to process and render some graph in DOT format. The dot file
I have an old .dot file with a few dozen styles in it. I
I have clients who still using dot matrix for making copies of printed documents
i have a doubt when we run the application (dot net application) dll or
I have a number of relatively simple (auto-generated) graphs in graphviz dot format. These
I have this XML structure that I wish to construct in JSON format using
I have a custom file format for graphs which looks like this: node1.link1 :

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.