|
The error is self-explanatory. You are using both SSL and a pickup folder, you can't use both. You either send over the network and use SSL, or write to the pickup folder which has no support for SSL. If you want to use the pickup folder don't set EnableSsl to true.
|
|
|
|
|
Can you kindly help or guide me on doing it the way you described? For example based on my code how can I can it so that 1. I can send email over the network and use SSL or 2. write to the pickup folder which has no support for SSL
|
|
|
|
|
The solution depends on if you want to use the pick-up folder or send over the network, something you haven't indicated.
|
|
|
|
|
The code below is from a desktop app that uses forms. I was asked to create a new web app to replace old desktop client app.
How can I change the following code to work in web app which does not have forms instead has aspx?
Please help.
private async void GetCasesButton_Click(object sender, EventArgs e)
{
if (CaseNumbersTextBox.Text.Length < 1)
{
MessageBox.Show("Casenumber textbox cannot be empty.", "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
ComboboxItem requestorItem = new ComboboxItem();
requestorItem = (ComboboxItem)RequestorComboBox.SelectedItem;
ComboboxItem reasonItem = new ComboboxItem();
reasonItem = (ComboboxItem)ReasonComboBox.SelectedItem;
if (requestorItem.Value < 1)
{
MessageBox.Show("Please select a Requestor.", "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (reasonItem.Value < 1)
{
MessageBox.Show("Please select a Reason.", "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
string userEnteredCaseNumbers = CaseNumbersTextBox.Text;
userEnteredCaseNumbers = userEnteredCaseNumbers.Replace("\r", ",");
userEnteredCaseNumbers = userEnteredCaseNumbers.Replace("\n", ",");
while (userEnteredCaseNumbers.Contains(",,"))
userEnteredCaseNumbers = userEnteredCaseNumbers.Replace(",,", ",");
List<string> userEnteredCaseNumberList = new List<string>();
userEnteredCaseNumberList = userEnteredCaseNumbers.Split(',').Where(x => x.Length > 0).ToList();
userEnteredCaseNumberList = userEnteredCaseNumberList.Select(s => s.Trim()).ToList();
try
{
int newBatchNumber = await CandidateCaseController.GetNextBatchNumber();
foreach (string caseNumber in userEnteredCaseNumberList)
{
EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
newCandidate.CaseNbr = caseNumber;
newCandidate.RequestorInfoID = requestorItem.Value;
newCandidate.ReasonID = reasonItem.Value;
newCandidate.BatchNumber = newBatchNumber;
newCandidate.EntryStaffUserName = this._loggedInUserName;
await CandidateCaseController.PostCandidate(newCandidate);
}
List<GetCandidateCaseModel> candidateList = await CandidateCaseController.GetAllCandidates();
candidateList = candidateList.Where(x => x.BatchNumber == newBatchNumber).ToList();
string candidateCasesString = string.Empty;
Regex rgxDash = new Regex("[^a-zA-Z0-9 ,]");
candidateCasesString = string.Join(",", candidateList.Select(p => p.CaseNbr.ToString()));
candidateCasesString = rgxDash.Replace(candidateCasesString, "").ToString();
List<string> smallEnoughStrings = new List<string>();
while (candidateCasesString.Length > 0)
{
int sendLength = 200;
bool isLastString = false;
if (candidateCasesString.Length < sendLength)
{
sendLength = candidateCasesString.Length;
isLastString = true;
}
string smallChunk = candidateCasesString.Substring(0, sendLength);
if (!isLastString)
{
int lastComma = smallChunk.LastIndexOf(',');
smallChunk = smallChunk.Substring(0, lastComma);
candidateCasesString = candidateCasesString.Remove(0, lastComma);
if (candidateCasesString[0] == ',')
candidateCasesString = candidateCasesString.Remove(0, 1);
}
else
candidateCasesString = candidateCasesString.Remove(0, sendLength);
smallEnoughStrings.Add(smallChunk);
}
List<AcceptCaseNumbersModel> mncisDetailList = new List<AcceptCaseNumbersModel>();
List<AcceptCaseNumbersModel> smallEnoughMncisDetailList = new List<AcceptCaseNumbersModel>();
foreach (string smallEnoughString in smallEnoughStrings)
{
smallEnoughMncisDetailList = await FTACaseReset.Controllers.JusticeController.GetAllAcceptCaseNumbers(smallEnoughString);
mncisDetailList.AddRange(smallEnoughMncisDetailList);
}
foreach (GetCandidateCaseModel candidateCase in candidateList)
{
string caseNbrWODash = rgxDash.Replace(candidateCase.CaseNbr, "").ToString();
AcceptCaseNumbersModel mncisDetail = mncisDetailList.Where(x => x.CaseNbrSrch.ToLower() == caseNbrWODash.ToLower()).FirstOrDefault();
if (mncisDetail != null)
{
candidateCase.FirstPenalty = mncisDetail.FirstPenaltyFlag == 1 ? true : false;
candidateCase.SecondPenalty = mncisDetail.SecondPenaltyFlag == 1 ? true : false;
if (candidateCase.CaseNbr.ToLower().Contains("vb") == false)
candidateCase.RejectionReason = await FTACaseReset.Controllers.RejectionController.GetRejectionByDescription(Enumerations.Rejections.No_Records_To_Reset.ToString().Replace("_", " "));
else if (candidateCase.FirstPenalty == false && candidateCase.SecondPenalty == false)
candidateCase.RejectionReason = await FTACaseReset.Controllers.RejectionController.GetRejectionByDescription(Enumerations.Rejections.No_Records_To_Reset.ToString().Replace("_", " "));
if (candidateCase.RejectionReason == null)
candidateCase.RejectionReason = await FTACaseReset.Controllers.RejectionController.GetRejectionByDescription(Enumerations.Rejections.Valid.ToString());
candidateCase.Title = mncisDetail.Style;
await FTACaseReset.Controllers.CandidateCaseController.PutCandidate(candidateCase);
}
else
{
candidateCase.RejectionReason = await FTACaseReset.Controllers.RejectionController.GetRejectionByDescription(Enumerations.Rejections.Invalid_Case_Number.ToString().Replace("_", " "));
await FTACaseReset.Controllers.CandidateCaseController.PutCandidate(candidateCase);
}
}
GetCasesProgressBar.PerformStep();
this.ClearForm();
ValidTabPage.Controls.Clear();
InvalidTabPage.Controls.Clear();
ValidTabPage.Text = "Valid Cases";
InvalidTabPage.Text = "Invalid Cases";
this.PopulateBatchComboBox();
List<GetCandidateCaseModel> thisBatchCasesList = new List<GetCandidateCaseModel>();
thisBatchCasesList = await Controllers.CandidateCaseController.GetCandidateByBatchID(newBatchNumber);
if (thisBatchCasesList.Count > 0)
this.EmailButton.Enabled = true;
else
{
this.EmailButton.Enabled = false;
return;
}
this.PopulateTabs(thisBatchCasesList, true);
this.GetCasesPanel.Visible = false;
this.UpdateExistingPanel.Visible = true;
ComboboxItem batchItem = new ComboboxItem(thisBatchCasesList[0].BatchNumber);
SelectBatch(batchItem);
ComboboxItem requestorUpdateItem = new ComboboxItem(thisBatchCasesList[0].RequestorInfo);
SelectRequestorUpdate(requestorUpdateItem);
ComboboxItem reasonUpdateItem = new ComboboxItem(thisBatchCasesList[0].Reason);
SelectReasonUpdate(reasonUpdateItem);
}
catch (Exception ex)
{
string errorMsg = string.Format("An error has occured in {0}. \nException:\n{1}", "GetCasesButton_Click()", ex.Message);
MessageBox.Show(errorMsg, "Application Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
|
|
|
|
|
No one is going to rewrite all of your code for you and quite frankly, it's very rude for you to ask us to. Converting desktop app to web app is not a trivial task.
Step 1. Learn the basics of web development. How and where code runs can be very different than desktop development.
Step 2. Rewrite the code. Figure out what the code does and then rewrite it for the web.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
ZurdoDev, I was not asking you or anyone to wrote the code for me. Maybe my question could have been rewritten to make more sense. I am working on the app and I will be asking simpler questions as I get stuck. I made a mistake and seems you are offended. That was not my intention to offend you and other or to be rude. Moving forward, I will post better questions. Everyone makes mistakes. I am sure you might agree with me. Accept my sincere apology.
|
|
|
|
|
I was asked to make a new web app based on a desktop client app which uses forms. My question today is, since some of the code I need help with is lengthy, is there a way to add code in my question by attaching a file?
|
|
|
|
|
No, when you ask a question just post the relevant code. It should never be very long.
Post a clear question showing the relevant code and we'll be happy to help.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Hello to everyone!
I need your support in coding that how should I add the speech audio to the paragraph texts/script in web-page by clicking on Read Button it should be played the audio and text should be appeared by type animation based on the audio.
Appreciate having your support in this regards!
|
|
|
|
|
I have not done this before; however, a quick google search gave me this, Add Free Text-to-Speech to Your Site | WebsiteVoice[^]
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Thank you very much for the sharing the link ZurdoDev! I want it a little professional, I have the script and recorded audio and I have problem in coding that how it should be displayed in Web page that audio should be played with script simultaneously or the same time.
|
|
|
|
|
Suppose I have a website written in asp.net and the database is SQL Server, after I "Publish the web site" and I want to encode this code for smartphones (both android and Android operating systems) iphone) what software do I use? Note that I only packaged the code in "Publish web site" and the SQL Server data I still kept on the server (not packing the SQL Server data)
|
|
|
|
|
Why do you want the website installed on a phone? The usual action for phones is that they access the website through their browsers.
|
|
|
|
|
Because I see several smartphone applications that can access SQL Server data, I don't know what programming language they use to do this.
|
|
|
|
|
That really does not make any sense. Applications can use SQL in just about any programming language. As to your original question, it is far from clear what you are trying to do with a phone app.
|
|
|
|
|
I can seem to get to what I need. Below is a portion of my code. I can get the table Id data but I need to get above the table and need
<div class="panel panel-primary" style="margin-top: 10px">
<div class="panel-heading">
Work Opportunities Available
</div>
<div class="panel-body">
<p id="noWorkopportunities" class="text-info">
No available work opportunities found.
</p>
</div></div>
I can get the table Id data but I need to get above the table and need Project Name/Work Order | Date | Time | Location | Pay Rate | Pay Type | Tech | Actions |
modified 7-Jan-20 11:09am.
|
|
|
|
|
Member 1753250 wrote: I can get the table Id data I would suggest you edit your question and show the code that can get the table id. Getting the table's parent is likely very trivial after that.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Thank You for the reply. Here is my code.
' Get all tables in the document
Dim tables As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//table")
' Iterate all rows in the first table
Dim rows As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//table[@id='workorders']//tr")
' Dim rows As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("tr")
' Iterate all rows in the first table
For k = 0 To rows.Count - 1
' Iterate all columns in this row
Dim cols As HtmlAgilityPack.HtmlNodeCollection = rows(k).SelectNodes("th|td")
' Dim cols As HtmlAgilityPack.HtmlNodeCollection = rows(k).SelectNodes("tr")
If cols IsNot Nothing Then
For j = 0 To cols.Count - 1
' Get the value of the column and print it
Dim value As String = cols(j).InnerText
If value = "Project Name/Work Order" Then
Foundwork = True
End If
Next
End If
Next
Here is the web source
div class="panel panel-primary" style="margin-top:10px;">
Work Opportunities Available
No available work opportunities found.
I want to check when
Project Name/Work Order Date Time Location Pay Rate Pay Type Tech Actions
|
|
|
|
|
So, what exactly is your question right now?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
My question is.. how do I find when No available work opportunities found. Thank you !!
<div class="panel panel-primary" style="margin-top:10px;">
<div class="panel-heading">
Work Opportunities Available
</div>
<div class="panel-body">
<img id="pw_workopportunities" src="/Images/pleaseWait.gif" alt="Please Wait" style="margin-left:10px" />
<p id="noWorkopportunities" class="text-info" style="display:none;">
No available work opportunities found.
</p>
<table id="workopportunities" style="display:none;" class="table table-bordered">
<tr>
<th>Project Name/Work Order</th>
' Get all tables in the document
Dim tables As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//table") <---- this statements successfully gets all the tables
Dim rows As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//p[@id='noWorkopportunities'") <---I get an error/nothing
' Iterate all rows in the first table
For k = 0 To rows.Count - 1
|
|
|
|
|
so I have the following code which I would like to adapt to take data straight from my sql database.
The code so far is:
@{
Layout = "~/Views/Shared/_Layout.cshtml";
var myChart = new Chart(width: 600, height: 400, theme: ChartTheme.Green)
.AddTitle("Product Life Cycle")
.AddSeries(
name: "Employee",
chartType: "Spline",
xValue: new[] { "2003", "2004", "2005", "2006", "2007", "2008", "2009", "20010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2022", "2023", "2024", "2025", "2026" },
yValues: new[] { "5.40", "16.17", "109.46", "347.87", "791.62", "1865.88", "2899.26", "4083.32", "4693.27", "6442.52", "8053.77", "9388.84", "9964.89", "10776.18", "4931.34", "2582.54", "752.53", "150.83", "77.87", "31.21", "0.33", "0", "0" })
.Write();
}
I would like to assign xValue and yValue to a table example TBL_MYdata and with the fields ConDate and ConUnits. I am very new to C# and realy need to sort this soon. Many thanks for any help available
|
|
|
|
|
Loading data from the database is best done in the controller, rather than the view.
Assuming you're using raw ADO.NET to access the database, something like this should work:
Controller:
public ActionResult YourAction()
{
var xValues = new List<string>();
var yValues = new List<string>();
using (var connection = new SqlConnection("... YOUR CONNECTION STRING HERE ..."))
using (var command = new SqlCommand("SELECT ConDate, ConUnits FROM TBL_MYdata ORDER BY ConDate", connection))
{
connection.Open();
using (var reader = command.ExecuteReader(CommandBehavior.CloseConnection))
{
while (reader.Read())
{
xValues.Add(Convert.ToString(reader["ConDate"]));
yValues.Add(Convert.ToString(reader["ConUnits"]));
}
}
}
var model = new Chart(width: 600, height: 400, theme: ChartTheme.Green)
.AddTitle("Product Life Cycle")
.AddSeries(name: "Employee", chartType: "Spline", xValues: xValues.ToArray(), yValues: yValues.ToArray());
return View(model);
} View:
@model Chart
@{
Layout = "~/Views/Shared/_Layout.cshtml";
Model.Write();
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi every one...
Can i use timer control without use java sicrpt?
I want to use it directly by vb.net code only without anymore java sicrpt
|
|
|
|
|
VB.NET has several specialized timers of its own; no need for the language of Mordor.
What are you trying to do? Show us some code, makes talking about it easier
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I have Get Method which I am expecting to open a pdf file in a new browser tab, but its not happening - below is the code
public void GetDoc(int id)
{
string fileInfo = "ID=[" + id + "] ";
try
{
var file = this.DomainLogicUnitOfWork.UploadedDocumentManager.GetById(id);
fileInfo = "FILENAME=[" + file.FileName + "]";
Response.Clear();
Response.ContentType = file.FileContentType;
Response.AppendHeader("content-disposition", "attachment; filename=" + file.FileName);
Response.OutputStream.Write(file.DocumentImage, 0, file.DocumentImage.Length);
Response.Output.Flush();
Response.End();
}
catch (Exception ex)
{
LogHandler.LogError(4617, "Error Downloading Document " + fileInfo, ex);
throw ex;
}
}
My url is opening correctly: http://localhost:xcxcxcx/Upload/GetDoc?id=1088 and it gives a warning when click on the start of the browser address and one more thing is the Word and other documents are being downloaded fine - means they are working fine but problem is just with PDF files. Any suggestions or ideas -
thank you all friends.
|
|
|
|
|