Questions tagged as 'c#'

3
answers

Initialize private fields in declaration or constructor?

I'm modeling a class that has a private list and an internal dependency to another object: public class Teste { private IList<string> Textos; private Teste2 Teste2; } I can initialize them in the declaration: private IList&l...
asked by 14.04.2017 / 02:59
2
answers

How do I read the log of incoming and outgoing calls on the iPhone using Xamarin?

How do I read the history record of incoming and outgoing calls on the iPhone using Xamarin? I need to read the log of outgoing / incoming calls on the iPhone. I do not know how to do it and I did not find material in Portuguese about it. Can...
asked by 20.01.2014 / 00:00
2
answers

How can I convert PNG to JPG in C #?

I'm working on an old project that uses ASP Site. I need to convert PNG image to JPG. How to do this? Note : I do not want to rename the file, I want to transform the mime from image/png to image/jpeg .     
asked by 24.11.2017 / 16:50
3
answers

Why methods that operate pointers are insecure in .NET?

Reading a little of the .NET source code I noticed that some methods have a peculiar modifier, the unsafe . [System.Security.SecuritySafeCritical] // auto-generated [System.Runtime.CompilerServices.FriendAccessAllowed] internal unsafe s...
asked by 09.10.2017 / 21:15
2
answers

Is there an equivalent to AndAlso and OrElse in C #?

In VB.NET there are two interesting operators: AndAlso and OrElse . When used, the logical expression is not fully evaluated at once. See the following example: If (Not Usuario Is Nothing) And (Usuario.Idade = 18) Then ... E...
asked by 27.07.2017 / 13:52
2
answers

Angled POST with customized header and CORS

I need to perform a POST request using angular (http.post) and I need to pass my access credentials (I am using basic authentication) to my API (.NET) in my header.    Authorization : Basic dXNlcm5hbWU6cGFzc3dvcmQ = No angular change the...
asked by 26.10.2015 / 18:17
3
answers

Parameter passing C #

I have the following code in js function consultaSolicitacao() { id = getVar("id"); serviceURL = "/Solicitacao/ConsultaSolicitacao"; $.get(serviceURL, null, function (data) { var aux = data.length; var tblText = ''; for...
asked by 13.05.2015 / 21:03
1
answer

How to make system login in the site using account of Instagram, Twitter or Google+ in Platform .NET (C #)

I want to develop something like this but I do not have any references how to do it, could you help me with some examples?     
asked by 08.04.2015 / 16:46
3
answers

Breadcrumb Algorithm in ASP.NET MVC

I'm writing a system on asp. net-mvc and the idea is that on the screens there is a Breadcrumb on all screens. Without ideas for a good algorithm, I booted a Helper that returns a list of objects according to the route accessed. The file is re...
asked by 28.02.2014 / 18:42
1
answer

Return Code object as inserted

I need to make an insert in the Entity Framework and at the same time it returns the code of the inserted object, thus preventing further access to the bank.     
asked by 06.09.2014 / 20:45