473,385 Members | 1,325 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C# - Please help: Url detection stopped working suddenly

latitude
Have had a few questions here but no replies so far so thought id give it one more go: Im working on a textviewer/editor and have used autodetect url on it, and it has worked fine. But somewhere along the road it just stopped working when opening files by clicking on them in explorer, works fine with drag n drop and by opening via filemenu. Code I use for opening program by clicking on files in explorer and where autodetect is NOT working is as following:

Expand|Select|Wrap|Line Numbers
  1. public static void Main(string[] args)
  2.         {
  3.             if(args.Length > 0)
  4.             {
  5.                 Form1 frm = new Form1();                
  6.                 System.IO.StreamReader myFile = new System.IO.StreamReader(args[0], System.Text.Encoding.Default);
  7.                 string line = "";
  8.                 line = myFile.ReadToEnd();
An example of opening file by menu which works fine with autodetect:


Expand|Select|Wrap|Line Numbers
  1. if (openFileDialog1.FileName != "")
  2.                 {
  3.                     FileStream file = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read);
  4.                     System.IO.StreamReader sr = new System.IO.StreamReader(file,System.Text.Encoding.Default);
ANY help is appreciated!!
Jan 19 '07 #1
2 1782
teddarr
143 100+
You've probably had no replies because this is the C/C++ board. C# is a .NET language and you should probablt post your question over there.
Jan 19 '07 #2
I have asked for a new section dedicated to C#, for now i were referred here by the moderators.....
Jan 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Alan | last post by:
Thought I'd post this in case it's useful to other searchers in the future. On one of my sites I noticed that session variables had suddenly stopped persisting across pages. Some things I had...
1
by: Andy | last post by:
I have drawn an icon. I used the the inverse color on the color window in order to get transparency. However, now the inverse color has stopped working by some reason. Why is this? I press and...
2
by: Dag Sunde | last post by:
I have the following code fragment in one of my pages: if (typeof document.getElementById('myApplet').getTableAsSDV != 'undefined') { rowBuffer =...
4
by: Marina | last post by:
Hi, A very weird thing has happened. Today, all the validators on all the pages and user controls on one of the servers stopped working. They seem to do the validation server side, instead of...
1
by: Mike | last post by:
I have an application that was developed in VB.NET. Its been in production since October without any problems and that was the last time anyone touched any of the code. Today I got a call from a...
1
by: J Rieggle | last post by:
Hi, Having been flamed for my previous HEEEELP! post and called childish, I decided to reframe this problem - I have to have something ready for tomorrow morning, and my server has stopped...
2
by: Kidan | last post by:
I built a small application that took export files from a sales application, and transformed them into the format necessary for importing by an accounting application. Both the Sales and the...
8
by: teddarr | last post by:
Last night while I was working on my project, all the buttons in my solution stopped working. I was moving the project from my local machine to my schools server. Does anyone know what I can do...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.