Search Results

Search found 81 results on 4 pages for 'slc'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • How do I convert a windows forms app from C# to VB ?

    - by SLC
    I've been converting all kinds of other things, classes, interfaces, ASP.NET MVC apps, and WPF applications, but I am stumped as to how to convert a windows forms application, as the whole structure seems to be different. Does anyone have any advice on how to tackle this problem? I see essentially that you have two files, Form1.cs and Form1.Designer.cs. Literally translating them from C# to VB doesn't work because of some intricacies or other of how Visual Basic works. I think you /might/ be able to convert Form1.cs in this way, as it's just a constructor plus event handlers, but the designer contains the references to the controls etc. and I am not sure how to go about doing that. I am using Visual Studio 2010 Beta 2.

    Read the article

  • How many times can you randomly generate a GUID before you risk duplicates? (.NET)

    - by SLC
    Mathematically I suppose it's possible that even two random GUIDs generated using the built in method in the .NET framework are identical, but roughly how likely are they to clash if you generate hundreds or thousands? If you generated one for every copy of Windows in the world, would they clash? The reason I ask is because I have a program that creates a lot of objects, and destroys some too, and I am wondering about the likelihood of any of those objects (including the destroyed ones) having identical GUIDs.

    Read the article

  • ASP.NET MVC 2 - How do I use DropDownListFor ?

    - by SLC
    I have a simple model / view with things like Username, Password etc. and use helpers fine to hook it up. I now have a field called "NumberOfChildren". I want to store a number in it (int) and I want it render a dropdown box containing "None", "1", "2" etc. My thoughts would be that the model would have a list or a method that returns a list, so I can specify the values such as NumberOfChildren_List that I put the data into, and then DropDownListFor pulls that list and renders it, matching the value to the value of the item in the dropdown. However after spending about 30 minutes on trying to figure out how on earth it works, I gave up and decided to ask here. Any ideas? Edit: Here's some code... <%: Html.DropDownListFor(m => m.NumberOfChildren, new SelectList(Model.NumberOfChildrenListValues))%> and in the model [Required] [DisplayName("How many children do you have?")] public string NumberOfChildren { get; set; } public IEnumerable<string> NumberOfChildrenListValues { get { List<string> list = new List<string>() { "None", "1", "2" }; return list; } set { } } I get an object not set to instance of object error though. Ideas?

    Read the article

  • Cannot edit ColumnDefinitions property in Visual Studio WPF application, ellipsis are invisible!

    - by SLC
    I have a window that looks like this: <Window x:Class="MyWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="My Title" Height="300" Width="300" ResizeMode="NoResize" SizeToContent="Height" WindowStartupLocation="CenterOwner"> <DockPanel> <Grid x:Name="MyGrid" DockPanel.Dock="Top" Margin="10"> </Grid> </DockPanel> </Window> Pretty simple. The instructions I am following suggest that if I click the item, the properties window will appear (it does), and then I can click ColumnDefinitions (which is a Collection) to bring up the Collection Editor and add some columns. However, the ColumnDefinitions property looks like this: The ColumnDefinitions ellipsis you'd normally press is gone, or invisible, or something. Any idea why?

    Read the article

  • How do I use "Into" LINQ expression in VB.NET?

    - by SLC
    I'm converting from C# this LINQ expression. However, it does not seem to work. C# return (from w in fishSticks group w by w.FishQty into g orderby g.Key descending select g).First().First(); VB Return (From w In fishSticks Group w By w.FishQty Into g() Order By g.Key Descending Select g).First().First() Visual Studio turns g into g() itself and then gives me this error: Definition of method 'g' is not accessible in this context. Any ideas?

    Read the article

  • Do similar passwords have similar hashes?

    - by SLC
    Our computer system at work requires users to change their password every few weeks, and you cannot have the same password as you had previously. It remembers something like 20 of your last passwords. I discovered most people simply increment a digit at the end of their password, so "thisismypassword1" becomes "thisismypassword2" then 3, 4, 5 etc. Since all of these passwords are stored somewhere, I wondered if there was any weakness in the hashes themselves, for standard hashing algorithms used to store passwords like MD5. Could a hacker increase their chances of brute-forcing the password if they have a list of hashes of similar passwords?

    Read the article

  • How can I generate a random human-readable colour from a seed? C#

    - by SLC
    Got a logfile, and it has all kinds of text in it. Currently it is just displayed as one colour, and each entry says something like: Log from section 1: Some text here Log from section 125: Some text here Log from section 17: Some text here Log from section 1: Some text here Log from section 125: Some text here Log from section 1: Some text here Log from section 17: Some text here Now the logfile is displayed in real time, and it would be nice to make the rows with the same section number the same colour. However there could be potentially quite a large range of numbers. What I want to do is create a method that will take a number, and randomly generate a unique colour. The colour must be readable against a black background though, so #000000 is no good, nor is #101010 or anything too dark to read. Ideally two similar numbers will not produce the same colour because in the above examples, the numbers 1 and 17 might be too similar, and some numbers might be in the 10,000 range. Any ideas on this?

    Read the article

  • What problem does NHibernate solve?

    - by SLC
    I've seen some jobs that require nhibernate knowledge, as well as numerous questions on stack. I found another question that pointed me to Summer Of NHibernate and I am watching the videos now. However it has no introduction explaining why NHibernate was created and what problem is solves. By looking on wikipedia, I can see vaguely what it does, but to me it looks like .NET already has the entity framework which seems to do the same thing. Can anyone clarify why nhibernate exists?

    Read the article

  • Understanding Covariant and Contravariant interfaces in C#

    - by SLC
    I've come across these in a textbook I am reading on C#, but I am having difficulty understanding them, probably due to lack of context. Is there a good concise explanation of what they are and what they are useful for out there? Edit for clarification: Covariant interface: interface IBibble<out T> . . Contravariant interface: interface IBibble<in T> . .

    Read the article

  • How can I write a "Hello World" app in assembly language?

    - by SLC
    I've often heard of applications written using the language of the gods, assembly language. I've never tried though, and I don't even have a clue how to do it. If I wanted to dabble, how would I go about doing it? I know absolutely nothing about what is required, although presumably some kind of compiler and Notepad. Just purely out of curiousity, what would I need to write a "Hello World!" application?

    Read the article

  • Can you have an extension method on a type instead of on an instance of a type?

    - by SLC
    I can have an extension method like this: DateTime d = new DateTime(); d = d.GetRandomDate(); GetRandomDate is my extension method. However the above doesn't make much sense. What would be better is: DateTime d = DateTime.GetRandomDate(); However, I don't know how to do this. An extension method created as: public static DateTime GetRandomDate(this System.DateTime dt) will only add the GetRandomDate() in the first example above, not the second one. Is there a way to achieve the desired behaviour?

    Read the article

  • What's an easy way of storing an array of numbers in Javascript that I can add/remove from?

    - by SLC
    In C# I would create a List then I could add and remove numbers very easily. Does identical functionality exist in Javascript, or do I have to write my own methods to search and remove items using a loop? var NumberList = []; NumberList.Add(17); NumberList.Add(25); NumberList.Remove(17); etc. I know I can use .push to add a number, so I guess it's really how to remove an individual number without using a loop that I'm looking for. edit: of course, if there's no other way then I'll use a loop!:)

    Read the article

  • How do I "DoEvents" in WPF?

    - by SLC
    I've read that the C# version is as follows: Application.Current.Dispatcher.Invoke( DispatcherPriority.Background, new Action(delegate { })); However I cannot figure out how to put the empty delegate into VB.NET, as VB.NET does not appear to support anonymous methods. Ideas? Edit: Possibly this? Application.Current.Dispatcher.Invoke( DispatcherPriority.Background, New Action(Sub() End Sub))

    Read the article

  • How do I run asynchronous code in asp.net mvc 2?

    - by SLC
    I tried this: BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (o, e) => { SendConfEmail(); }; bw.RunWorkerAsync(); but it didn't work. SendConfEmail takes a while to run. I guess it's because BackgroundWorker is designed for winforms not webforms. Any ideas how I can solve the problem?

    Read the article

  • How do I fix my Unit Test to have global access to everything?

    - by SLC
    Usually when you add one (in Visual Basic), it pops up a message asking if you want to enable an option that lets the test access things like private methods etc. However, I am editing a solution that does not have this enabled. I'd like to enable it so my unit tests will work, but I can't find the setting. Can anyone tell me how to enable it after the project has been created?

    Read the article

  • Div appearing outside its parent, bizarre sizing problems...

    - by SLC
    I have a list, which is going to be a menu. I want to position it absolutely at the very top of the page. My code looks like this: <div id="sitenavmenu"> <div id="sitenavmenu-content"> <ul id="sitenavmenu-content-menu"> <li>Register</li> <li><%: Html.ActionLink("About", "About", "Home")%></li> <li>Contact Us</li> </ul> </div> </div> My CSS looks like this: #sitenavmenu { position:absolute; margin-left:300px; top:2px; width:500px; } #sitenavmenu-content-menu li { list-style-type:none; display:inline; padding-right:5px; font-size:small; } The problem I have is, if I don't position it absolutely, it looks fine. As soon as I position it absolutely (as it is shown above), the sitenavmenu div changes size, and although it shifts to the top, the sitenavmenu-content div appears below it. There is no other CSS as I have only just started, and I have checked padding etc. and everything is zero. I just can't figure out why it's not working, and I don't want to hack it. Edit: It's something to do with the height of #sitenavmenu. If I leave it, then the sitenav-content ends up horizontally centered in it, although #sitenavmenu is much taller. If I make them both the same size, so they should sit on top of each other, then the #sitenavmenu-content sits below.

    Read the article

  • Handling a button click in MVC, why is there a string parameter?

    - by SLC
    I'm following this awful textbook, going through the basics of create/edit/delete records. The delete bit has a confirm button, and it is handled like so: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Delete(int id, string confirmButton) { It offers no explanation of why the button is passed as a string or how MVC interprets it. Can anyone help clarify what's going on here? The Create code has no such string being passed.

    Read the article

  • Javascript check all checkboxes in a table / asp.net

    - by SLC
    I have a table with rows in, and each row has a few <td> elements. The last element has a checkbox in. They are in a <div> which is set to runat="server". I have another checkbox on the page called "chkAll" that when clicked, I want to javascript check or uncheck all of the checkboxes in my table. I'm not very good at Javascript, so I am not sure what to do. I added a javascript onclick method, and put document.getelementbyid and put in the div.clientID, but I wasnt sure what to do from there. Any ideas?

    Read the article

  • How does an ASP.NET programmer go from working on/developing existing sites, to creating one from sc

    - by SLC
    I've been an ASP.NET developer for some time, always working on existing ASP.NET pages, modifying functionality, adding features, tweaking things etc. but have never built a site up from scratch. I've read books on ASP.NET, and they generally talk you through the various features of ASP.NET with a mock up site, but it's always very basic and they jump straight in. The time has come however, to write a site from scratch for a client. I've never done this before. There are design considerations, but like a lot of ASP.NET sites, the basic idea is, you have a site, where users can log in, and save some information like their name and password and address. The site has some functionality, but that's the basic design of a majority of (business-related) asp.net websites I would wager. I know how to program in ASP.NET already on an existing site, but I don't know how to design my own properly that meets the criteria above. I guess the main worry is security. I don't know the best way to handle a simple log-in system that stores user information like their name and password. I understand there are a few approaches to this, but the catch with this project is that it has to be absolutely bulletproof. Maximum security. All those good practices for security, it needs to have them all. I'm not asking what they are, but I am asking where to begin. What should be the first steps after I do File New Project ? Where can I look for information about setting up a secure ASP.NET website? I'll figure out the content and page layout later, it's the framework that is the big thing. Any and all advice would be welcome. I really want to get my first from-scratch project right from the beginning. Just to confuse things, it's possible I will be using MVC, I am not sure if this has any impact.

    Read the article

  • How do I do OuterHTML in firefox?

    - by SLC
    Part of my code I get the OuterHTML propery "<LI onclick="TabClicked(this, 'SearchName', 'TabGroup1');">Name " so I can do stuff involing parsing it. There is no OuterHTML property in javascript on firefox though and I can't find an alternative way to get this string. Ideas?

    Read the article

< Previous Page | 1 2 3 4  | Next Page >