Questions tagged as 'c#'

1
answer

Change default printer c #

I'm working on a solution where I need to change the default printer for a label printer to print and go back to the previous default printer. Would anyone have a solution for this?     
asked by 30.11.2017 / 13:05
2
answers

Print word file by C #

Hello everyone, I'm trying to print a word.doc file, I'm using the following code. using Microsoft.Office.Interop.Word; Microsoft.Office.Interop.Word.Application application = new Microsoft.Office.Interop.Word.Application(); string Cam...
asked by 04.06.2015 / 00:16
2
answers

Catch custom tags with Html Agility Pack

I'm using the Html Agility Pack plugin to handle html And I'd like it to capture my elements using% custom% I tried the following: HtmlDocument html = new HtmlDocument(); html.Load(new StringReader(Document.Content)); //A...
asked by 11.03.2015 / 20:09
3
answers

Directory Problems

I'm trying to read from an .html file but I can not get the path to this file. I already used Environment.GetCurrentDirectory and Directory.GetCurrentDirectory but did not succeed. Below is the code I'm currently trying, but it tri...
asked by 12.03.2015 / 20:12
1
answer

Reload page with MVC

I made a function in the model and the call in the controller. There, I move to jquery and the command to write to DB is successfully executed. It happens, that when I finish recording, the screen continues with the previous information, that is...
asked by 08.10.2014 / 14:15
1
answer

Convert string to specific format in date

I have a string "sex, nov 6" and need to convert to DateTime . I'm doing it this way: DateTime datetime = DateTime.Parse(gridT.Columns[e.ColumnIndex].HeaderText.ToString()); But it is not working. How can I do this conv...
asked by 06.11.2015 / 12:42
3
answers

Pass List as expression parameter LINQ

I have a LINQ expression where the result is saved in the query variable, which is transformed into a list, this query returns a series of "RA" attributes. p> I would like to pass this list of attributes as a parameter in the LINQ expressi...
asked by 04.11.2015 / 03:26
2
answers

Remove Time in the DateTime field

Dear,IneedtodisplayonlythedateinaTextBoxForfield.IusethisHTMLControlbecauseIuseaJavaScriptmaskthatformatsthefieldvalueatthetimeoftheinputofthedate.@Html.TextBoxFor(model=>model.DtCadastro,htmlAttributes:new{@id="DtCadastro", @name = "DtCadas...
asked by 17.11.2015 / 12:59
2
answers

Implementing relationship in C #

I have the following classes: Thecodelookslikethis:publicclassMae{publicstringNome{get;set;}publicList<Filho>Filhos{get;set;}}publicclassFilho{publicstringNome{get;set;}}Inthiscase,itispossibletogetallthesonsofthemother,butitisnotpossi...
asked by 09.11.2015 / 15:01
1
answer

How to locate an image without informing the absolute path?

How to locate an image without entering the absolute path? Image img = System.Drawing.Image.FromFile("~/Content/images/SemFoto.jpg"); I tried in many ways and could not capture the image without telling the absolute path. The above line of...
asked by 03.11.2015 / 14:43