title: How use asp.net get video duration
body: <pre><code>using Microsoft.DirectX.AudioVideoPlayback;
  
  Video vvideo = new Video(FileUpload.FileName.ToString());
  StringBuilder sb = new StringBuilder();
  sb.Append(duration.toString());
  error message;
  </code></pre>
  
  <p>“Installed an access attempt was made to the application domain.”</p>
  
  <p>“vvideo” instance is created error msj :// </p>
  
  <p>But down found cods    I found a working code in c #. but asp.net does not work</p>
  
  <pre><code>string file1 = "c://ds.mpeg"
  IMediaPosition m_objMediaPosition = null;
  FilgraphManager m_objFilterGraph = new FilgraphManager();
  m_objFilterGraph.RenderFile(filename);
  m_objMediaPosition = m_objFilterGraph as IMediaPosition;
  
  int s = (int)m_objMediaPosition.Duration;
  int h = s / 3600;
  int m = (s - (h * 3600)) / 60;
  s = s - (h * 3600 + m * 60);
  </code></pre>
  
  <p>I DON'T TAKE VIDEO DURATION BOYS :/</p>