我正在开发一个mean.io应用程序.我试图在永远的节点模块的Ubuntu shell上运行这个应用程序,但它抛出一个错误
"util.js:756
throw new TypeError('The super constructor to `inherits` must not ' +
^: The super constructor to `inherits` must not be null or undefined.
at Object.exports.inherits (util.js:756:11)
at Object.<anonymous> (/usr/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/monitor.js:142:7)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/usr/lib/node_modules/forever/node_modules/forever-monitor/lib/index.js:14:24)
at Module._compile (module.js:435:26)
Run Code Online (Sandbox Code Playgroud)
"
任何人都可以帮助解决这个实际问题,我如何解决这个错误.
我从一个来自word文件的字符串中提取子字符串.但index out of range即使子串的起始和结束索引小于字符串的长度,我也会收到错误.
for(int i=0;i<y.Length-1;i++)
{
if (Regex.IsMatch(y[i], @"^[A]"))
{
NumberOfWords= y[i].Split(' ').Length;
if (NumberOfWords > 5)
{
int le = y[i].Length;
int indA = y[i].IndexOf("A");
int indB = y[i].IndexOf("B");
int indC = y[i].IndexOf("C");
int indD = y[i].IndexOf("D");
//if (indD > 1 && indC > 1)
// breakop2 = breakop2 + '\n' + '\n' + y[i].Substring(indC, indD);
if (indC > 1 && indB > 1)
breakop1 = breakop1 + '\n' + y[i].Substring(indB, indC);
if (indB > 1) …Run Code Online (Sandbox Code Playgroud) 我已经开发了使用C#的GSMCOMM库发送短信的ac#应用程序,但是我面临的问题是三天是当我尝试使用gsmcomm objects.send message methode发送消息时,有时会给出电话异常的信息。未连接,有时会给异常端口未打开。我在下面共享我的代码:用于将PC连接到手机gsm调制解调器的代码。有时它会毫无例外地发送消息。
用于将电话连接到PC的代码。
private bool ConnectPhone()
{
string conectionStr = ConfigurationSettings.AppSettings["ConnectionString"].ToString();
clsFileLogger.VerifyLogFileDirectory();
clsFileLogger.WriteToLog("DB Connection: " + conectionStr);
conn = new SqlConnection(@conectionStr);
int port = Convert.ToInt32(ConfigurationSettings.AppSettings["port"]);
int baudRate = Convert.ToInt32(ConfigurationSettings.AppSettings["baudRate"]);
int timeout = Convert.ToInt32(ConfigurationSettings.AppSettings["timeout"]);
gsmComm = new GsmCommMain(port, baudRate, timeout);
try
{
Isconnected = false;
if (gsmComm.IsConnected() == false)
{
gsmComm.Open();
}
Isconnected = gsmComm.IsConnected();
clsFileLogger.WriteToLog("\nConnected with GSM Modam");
}
catch (Exception)
{
clsFileLogger.WriteToLog("\nUnable to open the port.");
}
return Isconnected;
}
Run Code Online (Sandbox Code Playgroud)
以及发送短信的代码
if (gsmComm.IsConnected() == false)
{
this.ConnectPhone(); …Run Code Online (Sandbox Code Playgroud) 我想char array="some text" 在文件中写一个字符数组 ,这是最简单的写入方式C.实际上我正在编写一个设备驱动程序,所以我必须在C中为设备驱动程序编写代码.从用户空间我必须读取一个数组来自用户空间的字符,也在内核空间写一个字符数组,但我是C的新手,这就是我问这个问题的原因.
我正在解析C#中的.doc文件以提取文本.
问题是.doc文件有表格,形状和图像,以及我的文本.我使用Microsoft Interop Word库来提取文本.当我提取文本时,我还获得了形状和图像上的标签,以及表格列和行内的数据.
我不需要表格或图像中的形状或数据标签.如何从我的.doc文件中删除这些形状,标签,图像和表格?
这是代码.
public void ReadMsWord()
{
// variable to store file path
string filePath = null;
// open dialog box to select file
OpenFileDialog file = new OpenFileDialog();
// dilog box title name
file.Title = "Word File";
// set initial directory of computer system
file.InitialDirectory = "c:\\";
// set restore directory
file.RestoreDirectory = true;
// execute if block when dialog result box click ok button
if (file.ShowDialog() == DialogResult.OK)
{
// store selected file path
filePath …Run Code Online (Sandbox Code Playgroud)