Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Xarzu

  • Rank
    (1) Prestidigitator
  1. I am new to .NET CORE but I have followed a few tutorials. The tutorials I have followed are basically "Hello World" types of programs where I make a small functional .Net Core application and I publish it. They are basically a DLL, I assume, and they run in some sort of system/container where they can run on any OS. Even though the final product is a DLL, the code itself seems to be structured in a way where it is an actual executable application. So how would I translate an actual C# DLL project into a .NET Core project? How would a project that is already designed to produce a DLL work in a .Net Core project? Executables only have one entry point: static void Main. .NET Libraries expose public methods which are all entry points in that sense. An "entry point" in a program is where the operating system invokes an executable program file, the term does not apply to libraries. (and ASP.NET web-application files are really just libraries, the ASP.NET host just looks for certain exposed Page/Handler/Controller types). This applies to ASP.NET. Does it also apply to .NET Core? Also, when I ran my .NET Core applications, I did it from a special command line. So how would that work if I translated a DLL C# program into a .NET Core program?
  2. How do I expose the LoadCompleted method in the WebBrowser class in WPF C#? I am trying to write a C# program in wpf that retrieves the content of a web page. The first thing I tried was to try the WebRequest and WebResponse classes. This did not provide the actual displayed content. WebResponse reveils the HTML code that is sent to the browser. But I discovered that, while the page is being loaded by the browser, javascript can change what content is finally displayed in the browser. So I decided to use the WebBrowser class. Immediately I found that there are two WebBrowser classes. Thee is the one that is documented for WinForms and there is another that is documented for WPF. I need to understand the one documented for WPF. What I think I neeed to know what to do is to retrieve code after the "LoadCompleted" method is caused. But I do not know how to this and I cannot find any example demonstrating how this is done.
  3. How To Modify An Element in the Dictionary Class? ======================================= C# has this cool Dictionary class that you can use like a Hash Table. Is there a way of changing the value of an indexed element without resorting to removing it like this? int value = runningcount[city]; runningcount.Remove(city); runningcount.Add(city, ++value);
  4. C# Split String Is Not Working ====================== Please Help. I wrote a C# program that reads code one line at a time. Each line has data seperated by tabs. Here is what my C# code is supposed to do. The line is supposed to be split into a string array by using the "Split" string methodIt is supposed to be spit read in text one line at a time and I use the "Split" method to group the line according to the tab character. But, as this screen shot shows, it does not work. Any idea why?
  5. In a silverlight app, I have a BitmapImage defined as System.Windows.Media.Imaging.BitmapImage and it as a method called "SetSource" where I can set the source like this: BitmapImage bitmap = new BitmapImage(); System.IO.Stream stream = _scene.GetStream(); if (stream == null) return; bitmap.SetSource(stream); In a WPF application I have also have a Bitmap image defined as System.Windows.Media.Imaging.BitmapImage but there is no SetSource method. How do I set the source in a WPF app like I do in a Silverlight app? Also, it is a stream, not a string. It is not a URI. so "UriSource" method does not work. I tried this: System.IO.Stream stream = _scene.GetStream(); if (stream == null) return; BitmapImage bitmap = new BitmapImage(); bitmap.UriSource = new Uri(stream.ToString()); And at runtime, it threw an error tha URI cannot be determined. Is the URI an identifier for the intranet? Are you sure that this is not a silverlight thing? I am doing a WPF application
  6. How do you set a default size of a control that you can resize? I have been looking at a code sample from Charles Petzold. It is from here: http://www.charlespetzold.com/blog/2009/05...ilverlight.html it uses mouse over methods to increase the size of button classes. I have it working but I want to make some modifications. I want the starting size of the button to be larger. I do not know how much of the code I need to post here to make the issue clear enough. The XAML for the page describes a "FisheyeButton" that is described in a seperate xaml file. Something like this: <StackPanel x:Name="LayoutRoot" Width="1017" Orientation="Horizontal" Height="253"> <src:FisheyeButton Style="{StaticResource btnStyle}" ButtonContent="Button No. 1" /> </StackPanel> The functionality of the project is such that if I give the Fisheyebutton a width and height a set size at this loction, the effect where the size of the control the effect of becoming larger does not happen. In other words, if I write in the <src:FisheyeButton... tag above Width="100", then the button does not behave at run time as it should. In the same page.xaml file, the btnStyle is defined like this: <UserControl.Resources > <Style x:Key="btnStyle" TargetType="src:FisheyeButton"> <Setter Property="VerticalAlignment" Value ="Center" /> <Setter Property="HorizontalAlignment" Value ="Center" /> <Setter Property="FontSize" Value ="12" /> </Style > </UserControl.Resources > I wonder if perhaps at this point, I can add a "Setter" property to define a default starting widh and height for the class.
  7. Help me Convert this WPF to Silverlight I am interested in a Charles Petzold C# example that shows how to do a fisheye effect ( http://www.charlespetzold.com/blog/2009/05...ilverlight.html ). The XAML code samples are in WPF but I want to try this in Silverlight. When I try to create the XAML code in Silverlight, the compiler complains in two locations: <Style TargetType="{x:Type Button}"> Error 1 The type 'x:Type' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. <Style.Triggers> Error 2 The attachable property 'Triggers' was not found in type 'Style'. How do I convert this to Silverlight?
  8. How do I get a dattime format in C# that will look like this: 2011-09-01 00:00:00:000
  9. Silverlight is designed differently where it is not possible for a silverlight program running inside a browser can have access to a user's hard drive. This is a good thing and is important for security. But there are times when it might be a good idea to save some settings on the client side. I kind of remember that there is some sort of protected space for that. Does anyone have any ideas?
  10. I think it was a memory thing. After I closed some files and some programs, it did not fix the problem, but after I rebooted, it fixed the issue.
  11. TextBlock wrapping of text in Silverlight XAML file. I have a wierd and annoying problem. I have a textblock that is inside a stackpanel that is Oriented horizontal. It would be nice if I could have the textblock appear in multiple lines nicely wrapped. How could I do that?
  12. When editing an XAML file using visual studio 2010 sometimes the tick marks to colapse groups are there and sometimes they are not. Can anyone tell me why?
  13. How Do I Fix Product Key Issue? =============================== I bought and built my computer from scratch. It was a couple of years already but I remember it was from EggHead online. Ah, but it did not go smoothly. I was not used to all the chips and connections and such. But I decyphered the instuctions and I got it put togehter. And it did not run. It took days and the days became weeks. I had to resort to to doing a lot of trial and error and calling up everyone who made each individual part. I considered that it might be my genuine Microsoft Vista installation CD Itself since this was where the process was croaking. So I found another OS CD to give it a try. It still did not work and so I began focusing on other problems. In the end, it turned out to be the hard drive which was still under warentee and I shipped back and the Egg Heads replaced it. Ta-Dah!! Eureka!! I had a working computer. But in the confusion, did you see, perhaps, where I took a wrong, but all to human and innocent, turn? I put an operating system on my computer from a CD that I did not buy!!! The HORROR!!! But the time I noticed that there made a confused switch and the CD that I bought was back at work and I had the one from work at home, I had moved on to another contract and I could not fix the error. I have a genuine product key. I need to change the product key I typed in when I first installed the OS to the right one. How do I do this?
  14. I have a program written in C#. It consists of a small main executable and several added DLL's. In other words, it is a Solution with several added projects. Here is where it gets interesting. A co-worker has created a stand-alone executable that does somethnig that I can use in my program. The co-workers program produces an exe when compiled and it has its own main routine. His program has its own namespeace and has just one class. The plan is for me to create my own class in my code that inherits the co-workers class. How do I do this? Also, are there special considerations to be given since I am going to make my own class and DLL that uses his code that is written as if it was a single execuatable?
  15. I have an old hard drive that has those old ribbon connections to transfer data to the mother board. I have a new computer that mostly uses those cool little ATA (I think that is what they are called) connections. The new computer has a Vista OS. I opened up the case and I was supprised to see on the motherboard a wide ribbon connection and so I connected the old hard drive and a free power connection. When I turned on the computer, the system started up like usual and did not notice the new hard drive. I went to the Control Pannel and did an automatic add hard drive call and it did not find the old hard drive. Any suggestions? I think my old hard drive is called an IDE drive. The Jumpers are set to slave. The system does not see it. Maybe I need to get the driver from the manufacturer. Another thing is this. Does it matter where on the ribbon you connect the harddrive? The ribbon has one connection at the end and anotther one in the middle. I am connecting it to the end. The hard drive is a seagate model ST320413A and their website does not provide any suggestions for download a driver or making the system recognize the drive. When I right click on "Computer" and choose manage and click on "Disk Management", here is what I see after I have rebooted and tried a couple of times: What now?
  • Create New...