.net-2.0

Visual Basic How do I read a CSV file and display the values in a datagrid?

我的梦境 提交于 2019-12-19 03:42:10
问题 I'm using VB 2005, how do I open a CSV file and read the columns/rows and display the values in a datagrid? CSV file example: jsmith,jsmith@hotmail.com I then want to perform an action on each row i.e. each user, how would I do this? I'm a newbie as you can tell but happy to learn. Thanks 回答1: Use the TextFieldParser that's built into VB.NET. Google found me this example Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser _ ("C:\test\info.csv") 'Specify that reading from a

How do I send ctrl+c to a process in c#?

删除回忆录丶 提交于 2019-12-19 03:20:32
问题 I'm writing a wrapper class for a command line executable. This exe accepts input from stdin until I hit Ctrl+C in the command prompt shell, in which case it prints output to stdout based on the input. I want to simulate that Ctrl+C press in C# code, sending the kill command to a .NET Process object. I've tried calling Process.Kill() , but that doesn't seem to give me anything in the process's StandardOutput StreamReader . Might there be anything I'm not doing right? Here's the code I'm

How to take a screenshot and send by email programaticly on dotnet

白昼怎懂夜的黑 提交于 2019-12-18 18:07:43
问题 Background: I'm developing a bussiness application, and in the final stages we are encountering some extrange errors, mostly with connection and some edge use cases. For this kind of exceptions, we now provide a nice dialog with error details, of which the user take a screenshot, and send by email with some remarks. Problem: I would like to provide a better experience, and provide a single button in the same dialog, wich uppon click, would open outlook and prepare the email, with a screenshot

HttpWebRequests Failing on Subsequent Calls

£可爱£侵袭症+ 提交于 2019-12-18 16:56:18
问题 I know this is a vague question, especially since I am not providing any code, but I am developing a .Net 2.0 application, and we have a WebRequest which posts data to an internally built API. The strange thing happens on our 3rd (and always the 3rd) subsequent request which fails at the GetRequestStream() method of the request. The first and second time its called, all is fine. On the 3rd time, it hangs for a bit and eventually times out. The API is being called by other applications in

Call a webpage from c# in code

别来无恙 提交于 2019-12-18 12:57:17
问题 I need a way of calling a web page from inside my .net appliction. But i just want to send a request to the page and not worry about the response. As there are times when the response can take a while so i dont want it to hang the appliction. I have been trying in side the page_load event WebClient webC = new WebClient(); Uri newUri = new Uri("http://localhost:49268/dosomething.aspx"); webC.UploadStringAsync(newUri, string.Empty); Even though its set to Async, it still seams to hang as the

Does using assembly compiled in older version of .NET framework affects whole performance?

白昼怎懂夜的黑 提交于 2019-12-18 11:55:38
问题 Lets imagine that we have two assemblies: Foo.Logic (compiled on .NET 2.0 framework) Foo.Application (compiled on .NET 4.0 framework) that have reference and uses compiled Foo.Logic. Does it have impact on Foo.Application performance (or have any other drawbacks)? 回答1: In the situation you described in the question, everything will Just Work™ without any problems. A .NET 4.0 application will load a .NET 2.0 library directly into the .NET 4.0 runtime environment. It will not use side-by-side

Creating a delegate type inside a method

一笑奈何 提交于 2019-12-18 11:46:02
问题 I want to create a delegate type in C# inside a method for the purpose of creating Anonymous methods. For example: public void MyMethod(){ delegate int Sum(int a, int b); Sum mySumImplementation=delegate (int a, int b) {return a+b;} Console.WriteLine(mySumImplementation(1,1).ToString()); } Unfortunately, I cannot do it using .NET 2.0 and C# 2.0. 回答1: Why do you want to create the delegate type within the method? What's wrong with declaring it outside the method? Basically, you can't do this -

Replace UpdatePanel with JQuery

徘徊边缘 提交于 2019-12-18 10:45:26
问题 I'm using UpdatePanel to asynchronously call a button click event in a page that calls a method in another class which writes out an XML file on the output. Is there a way to do this with JQuery instead of UpdatePanel? 回答1: Use jQuery to handle the click event. Then call a page method in the code-behind using this technique. From there you can write the XML file or do whatever else you want. 回答2: A simple alternative way to using jQuery to do ajax without the update panel is to use a build in

Convince me to move to .net 3.5 (from 2.0) [closed]

无人久伴 提交于 2019-12-18 10:23:13
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am into new desktop app development. I feel at home with .NET 2.0 and c#. I guess I don't need linq, nor care for WPF and other

Localization: How to map culture info to a script name or Unicode character range?

时间秒杀一切 提交于 2019-12-18 09:12:27
问题 I need some information about localization. I am using .net 2.0 with C# 2.0 which takes care of most of the localization related issues. However, I need to manually draw the alphabets corresponding to the current culture on the screen in one particular screen. This would be similar to the Contacts screen in Microsoft Outlook (Address Cards view or Detailed Address Cards View under Contacts), and so it needs a the column of buttons at the right end, one for each alphabet. I am trying to